Esempio n. 1
0
        public override void Dispose()
        {
            base.Dispose();
            _PointerVariable?.Dispose();

            foreach (var v in _Variables.AllVariables)
            {
                v.Dispose();
            }
        }
Esempio n. 2
0
            public void Reset()
            {
                uxMessagesWaiting?.Dispose();
                uxMessagesWaiting = null;
                uxLength?.Dispose();
                uxLength = null;

                u_xSemaphore_xMutexHolder?.Dispose();
                u_xSemaphore_xMutexHolder = null;
                u_xSemaphore_uxRecursiveCallCount?.Dispose();
                u_xSemaphore_uxRecursiveCallCount = null;
            }
Esempio n. 3
0
        public void Dispose()
        {
            foreach (var threadList in _AllThreadLists)
            {
                threadList.Dispose();
            }

            _pxCurrentTCB.Dispose();
            _uxCurrentNumberOfTasks.Dispose();

            StateThreadListCache.Dispose();
            EventThreadListCache.Dispose();
        }
 public override void Dispose()
 {
     _HeapEndVariable.Dispose();
     _BorderVariable?.Dispose();
     base.Dispose();
 }
Esempio n. 5
0
 public void Dispose()
 {
     _Variable?.Dispose();
     lock (_Cache._Nodes)
         _Cache._Nodes.Remove(_Address);
 }
Esempio n. 6
0
 public void Dispose()
 {
     xListEnd_pxNext.Dispose();
 }
Esempio n. 7
0
 public override void Dispose()
 {
     base.Dispose();
     _Variable.Dispose();
 }
Esempio n. 8
0
 public override void Dispose()
 {
     base.Dispose();
     _pxCurrentTCB.Dispose();
 }
Esempio n. 9
0
 public override void Dispose()
 {
     _xSchedulerRunning?.Dispose();
     base.Dispose();
 }
Esempio n. 10
0
            public override LiveWatchNodeState UpdateState(LiveWatchUpdateContext context)
            {
                int estimatedStackSize = ProvideEstimatedStackSize(out var pxStack);

                if (_OverflowDetected)
                {
                    return(ReportStackOverflow(estimatedStackSize));
                }

                var rawValue = _BorderVariable?.GetValue() ?? default;

                if (!rawValue.IsValid || CountUnusedStackArea(rawValue.Value) != rawValue.Value.Length)
                {
                    int queriedStackSize;
                    if (_BorderVariable != null)
                    {
                        queriedStackSize = (int)(_BorderVariable.Address - pxStack);
                    }
                    else
                    {
                        queriedStackSize = (int)(_ThreadNode._Engine.ReadMemory(_ThreadNode._Variables.pxTopOfStack).ToUlong() - pxStack);
                    }

                    _BorderVariable?.Dispose();
                    _BorderVariable = null;

                    if (queriedStackSize < 0)
                    {
                        return new LiveWatchNodeState {
                                   Icon = LiveWatchNodeIcon.Error, Value = $"Unexpected stack size ({queriedStackSize})"
                        }
                    }
                    ;

                    var data = _ThreadNode._Engine.Memory.ReadMemory(pxStack, queriedStackSize);
                    if (!data.IsValid)
                    {
                        return new LiveWatchNodeState {
                                   Icon = LiveWatchNodeIcon.Error, Value = $"Failed to read stack contents (0x{pxStack:x8} - 0x{pxStack + (uint)queriedStackSize:x8})"
                        }
                    }
                    ;

                    int offset = CountUnusedStackArea(data.Value);

                    //We don't know whether it is a stack overflow, or if the empty stack is never filled with the pattern.
                    //We assume that if the stack appears overflown from the very beginning, the pattern is not being used at all.
                    _OverflowDetected = offset == 0;
                    if (offset != 0)
                    {
                        _PatternEverFound = true;
                    }

                    if (offset == 0)
                    {
                        return(ReportStackOverflow(estimatedStackSize));
                    }
                    else
                    {
                        int watchSize = Math.Min(_MaxBorderVariableSize, offset);

                        _BorderVariable = _ThreadNode._Engine.Memory.CreateLiveVariable(pxStack + (uint)(offset - watchSize), watchSize, "Stack Border");
                    }
                }

                int freeStack  = (int)(_BorderVariable.Address - pxStack) + _BorderVariable.Size; /* The border variable watches the 1st free slot, not the 1st used one */
                int stackUsage = estimatedStackSize - freeStack;

                RawValue = new LiveVariableValue(rawValue.Timestamp, rawValue.Generation, BitConverter.GetBytes(stackUsage));

                string text;

                if (estimatedStackSize > 0)
                {
                    text = $"{stackUsage}/{estimatedStackSize} bytes";
                }
                else
                {
                    text = $"{stackUsage} bytes";
                }

                return(new LiveWatchNodeState
                {
                    Value = text
                });
            }