Exemple #1
0
        public NodeSource(ILiveWatchEngine engine)
        {
            Engine = engine;

            _TCBType   = (IPinnedVariableStructType)engine.Symbols.LookupType("TCB_t", true);
            _QueueType = (IPinnedVariableStructType)engine.Symbols.LookupType("Queue_t");

            var xStateListItem_Offset = _TCBType.LookupMember("xStateListItem", true).Offset;

            xEventListItem_Offset = _TCBType.LookupMember("xEventListItem", true).Offset;

            var listItemType   = (IPinnedVariableStructType)engine.Symbols.LookupType("ListItem_t", true);
            var pvOwner_Offset = (int)listItemType.LookupMember("pvOwner", true).Offset;
            var pxNext_Offset  = (int)listItemType.LookupMember("pxNext", true).Offset;

            StateThreadListCache = new LinkedListNodeCache(engine, pvOwner_Offset, pxNext_Offset);
            EventThreadListCache = new LinkedListNodeCache(engine, pvOwner_Offset, pxNext_Offset);

            _pxCurrentTCB           = engine.CreateLiveVariable("pxCurrentTCB", true);
            _uxCurrentNumberOfTasks = engine.CreateLiveVariable("uxCurrentNumberOfTasks", true);

            foreach (var pxReadyTaskList in engine.Symbols.LookupVariable("pxReadyTasksLists")?.LookupChildren(0) ?? new IPinnedVariable[0])
            {
                ThreadList.Locate(_AllThreadLists, engine, pxReadyTaskList, ThreadListType.Ready, xStateListItem_Offset);
            }

            ThreadList.Locate(_AllThreadLists, engine, engine.Symbols.LookupVariable("xDelayedTaskList1"), ThreadListType.Delayed, xStateListItem_Offset);
            ThreadList.Locate(_AllThreadLists, engine, engine.Symbols.LookupVariable("xDelayedTaskList2"), ThreadListType.Delayed, xStateListItem_Offset);
            ThreadList.Locate(_AllThreadLists, engine, engine.Symbols.LookupVariable("xSuspendedTaskList"), ThreadListType.Suspended, xStateListItem_Offset);

            _Children = new ILiveWatchNode[] { new KernelNode(this, engine), new ThreadListNode(this), new QueueListNode(this), new HeapStructureNode(this) };
        }
Exemple #2
0
            public WaitingThreadsNode(QueueNode queue, string idSuffix, string name, string memberName)
                : base(queue.UniqueID + idSuffix)
            {
                _Queue = queue;
                Name   = name;

                QueueAddress = _Queue._QueueVariable.Address;
                var threadListVariable = _Queue._QueueVariable.LookupSpecificChild(memberName);

                _ThreadList = ThreadList.Locate(_Queue._Engine, threadListVariable, ThreadListType.Event, _Queue._Root.xEventListItem_Offset, true);
                _Queue._Root.OnQueueNodeSuspended(this, false);
                SelectedFormatter = _Queue._Engine.GetDefaultFormatter(ScalarVariableType.SInt32);
            }