Esempio n. 1
0
        private ParserParagraph PrepareSupervisorStack(ThreadStackInfo aStackInfo)
        {
            ParserParagraph para = new ParserParagraph("STACK_SUPERVISOR");
            //
            ParserLine l1 = ParserLine.NewSymFormat("Supervisor stack base at %08x, size == %x\r\n");

            l1.ElementComplete += new ParserElementBase.ElementCompleteHandler(DisableUserStackParagraph);
            l1.SetTargetProperties(aStackInfo, "BaseAddress", "Size");
            //
            ParserLine l2 = ParserLine.NewSymFormat("Stack pointer == %08x\r\n");

            l2.SetTargetProperties(aStackInfo, "StackPointer");

            // Collect the raw stack bytes
            ParserLine l3 = ParserLine.NewSymFormat("%08x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x");

            l3.IsNeverEnding       = true;
            l3.DisableWhenComplete = false;
            l3.SetTargetMethod(aStackInfo.Data, "Add");

            // Record the starting address of the stack data
            l3[0].SetTargetMethod(this, "SetFirstStackBytesStartingAddress");
            l3[0].Tag = aStackInfo;
            //
            para.Add(l1, l2, l3);
            return(para);
        }
Esempio n. 2
0
        private ParserParagraph CreateMessageQueueCommon(string aName, DMsgQueue aQueue)
        {
            ParserParagraph para = new ParserParagraph(aName);
            //
            ParserLine l1 = ParserLine.NewSymFormat("StartOfPool %08x, EndOfPool %08x\r\n");

            l1.SetTargetProperties(aQueue.PoolInfo, "Start", "End");
            //
            ParserLine l2 = ParserLine.NewSymFormat("FirstFullSlot %08x, FirstFreeSlot %08x\r\n");

            l2.SetTargetProperties(aQueue.SlotInfo, "FirstFull", "FirstFree");
            //
            ParserLine l3 = ParserLine.NewSymFormat("MaxMsgLength %d\r\n");

            l3.SetTargetProperties(aQueue, "MaxMessageLength");
            //
            ParserLine l4 = ParserLine.NewSymFormat("MessageQueue state %S");

            l4.Tag = aQueue;
            l4.SetTargetMethod(this, "SetMessageQueueState");
            //
            ParserLine l5 = ParserLine.NewSymFormat("ThreadWaitingForData %08x, DataAvailStatPtr %08x\r\n");

            l5.SetTargetProperties(new object[] { aQueue.WaitData, aQueue.WaitData.RequestStatus }, "WaitingThreadAddress", "Address");
            //
            ParserLine l6 = ParserLine.NewSymFormat("ThreadWaitingForSpace %08x, SpaceAvailStatPtr %08x\r\n");

            l6.SetTargetProperties(new object[] { aQueue.WaitSpace, aQueue.WaitSpace.RequestStatus }, "WaitingThreadAddress", "Address");

            para.Add(l1, l2, l3, l4, l5, l6);
            return(para);
        }
Esempio n. 3
0
        private ParserParagraph CreateThreadCommon(string aName, NThread aThread)
        {
            ParserParagraph para = new ParserParagraph(aName);
            //
            ParserLine l1 = ParserLine.NewSymFormat("Next=%08x Prev=%08x Att=%02x\r\n");

            l1.SetTargetProperties(new object[] { aThread.LinkedListInfo, aThread.LinkedListInfo, aThread }, "Next", "Previous", "Attributes");
            //
            ParserLine l2 = ParserLine.NewSymFormat("HeldFM=%08x WaitFM=%08x AddrSp=%08x\r\n");

            l2.SetTargetProperties(new object[] { aThread.MutexInfo, aThread.MutexInfo, aThread }, "HeldAddress", "WaitAddress", "AddressSpace");
            //
            ParserLine l3 = ParserLine.NewSymFormat("Time=%d Timeslice=%d ReqCount=%d\r\n");

            l3.SetTargetProperties(new object[] { aThread.TimeInfo, aThread.TimeInfo, aThread.CountInfo }, "Time", "Timeslice", "RequestSemaphoreCount");
            //
            ParserLine l4 = ParserLine.NewSymFormat("LastStartTime=%08x TotalCpuTime=%lx Tag=%08x\r\n");

            l4.SetTargetProperties(aThread.TimeInfo, "LastStartTime", "TotalCpuTime", "Tag");
            //
            ParserLine l5 = ParserLine.NewSymFormat("ReturnValue=%d, UCT=%d\r\n");

            l5.SetTargetProperties(aThread, "ReturnValue", "UserContextType");
            //
            ParserLine l6 = ParserLine.NewSymFormat("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n");

            l6.SetTargetProperties(aThread.CountInfo, "SuspendCount", "CsCount", "CsFunctionRaw");
            //
            ParserLine l7 = ParserLine.NewSymFormat("SavedSP=%08x ExtraContext=%08x ExtraContextSize=%08x\r\n");

            l7.SetTargetProperties(new object[] { aThread, aThread.ExtraContextInfo, aThread.ExtraContextInfo }, "SavedSP", "ExtraContext", "ExtraContextSizeRaw");
            //
            para.Add(l1, l2, l3, l4, l5, l6, l7);
            return(para);
        }
Esempio n. 4
0
        private ParserParagraph CreateMonitorProcessMemModelMultiple(string aName, DProcess aProcess, ParserElementBase.ElementCompleteHandler aLastFieldHandler)
        {
            ParserParagraph para = new ParserParagraph(aName);

            para.Tag = aProcess;
            if (aLastFieldHandler != null)
            {
                para.ElementComplete += new ParserElementBase.ElementCompleteHandler(aLastFieldHandler);
            }

            // Misc
            ParserLine l0 = ParserLine.NewSymFormat("OS ASID=%d, LPD=%08x, GPD=%08x\r\n");

            l0.SetTargetProperties(aProcess, "OSASID", "LPD", "GPD");

            // Loop body - construct this first as we use it for the header line
            ParserLine l2 = ParserLine.NewSymFormat("%d: Chunk %08x, access count %d\r\n");

            l2[0].SetTargetObject();
            l2[1].SetTargetMethod(this, "AddChunkToProcess");
            l2[2].SetTargetMethod(this, "SetChunkAccessCount");

            // Loop header
            ParserLine l1 = ParserLine.NewSymFormat("ChunkCount=%d ChunkAlloc=%d\r\n");

            l1[0].SetTargetMethod(l2, "SetRepetitions");

            para.Add(l0, l1, l2);
            return(para);
        }
Esempio n. 5
0
        private ParserParagraph PrepareUserStack(ThreadStackInfo aStackInfo)
        {
            ParserParagraph para = new ParserParagraph(KParagraphUser);
            //
            ParserLine l0 = ParserLine.New("No user-mode stack");

            l0.ElementComplete += new ParserElementBase.ElementCompleteHandler(NoUserStackCallBack);
            //
            ParserLine l1 = ParserLine.NewSymFormat("User stack base at %08x, size == %x\r\n");

            l1.SetTargetProperties(aStackInfo, "BaseAddress", "Size");
            //
            ParserLine l2 = ParserLine.NewSymFormat("Stack pointer == %08x\r\n");

            l2.SetTargetProperties(aStackInfo, "StackPointer");
            //
            // Not needed - ParserLine l3 = ParserLine.NewSymFormat( "Stack mapped at %08x\r\n" );
            //l3.SetTargetProperties( aStackInfo.Data, "MappedAddress" );

            // Collect the raw stack bytes
            ParserLine l4 = ParserLine.NewSymFormat("%08x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x");

            l4.IsNeverEnding       = true;
            l4.DisableWhenComplete = false;
            l4.SetTargetMethod(aStackInfo.Data, "Add");

            // Record the starting address of the stack data
            l4[0].SetTargetMethod(this, "SetFirstStackBytesStartingAddress");
            l4[0].Tag = aStackInfo;
            //
            para.Add(l0, l1, l2, l4);
            return(para);
        }
Esempio n. 6
0
        private ParserParagraph CreateMonitorProcessCommon(string aName, DProcess aProcess)
        {
            ParserParagraph para = new ParserParagraph(aName);
            //
            ParserLine l1 = ParserLine.NewSymFormat("ExitInfo %d,%d,%lS\r\n");

            l1.SetTargetProperties(aProcess.ExitInfo, "Type", "Reason", "Category");
            //
            ParserLine l2 = ParserLine.NewSymFormat("Flags %08x, Handles %08x, Attributes %08x\r\n");

            l2.SetTargetProperties(aProcess, "Flags", "Handles", "Attributes");
            //
            ParserLine l3 = ParserLine.NewSymFormat("DataBssChunk %08x, CodeSeg %08x\r\n");

            l3.SetTargetProperties(aProcess, "DataBssStackChunkAddress", "CodeSegAddress");
            //
            ParserLine l4 = ParserLine.NewSymFormat("DllLock %08x, Process Lock %08x SID %08x\r\n");

            l4.SetTargetProperties(new object[] { aProcess.LockInfo, aProcess.LockInfo, aProcess }, "DllMutexAddress", "ProcessMutexAddress", "SID");
            //
            ParserLine l5 = ParserLine.NewSymFormat("TempCodeSeg %08x CodeSeg %08x Capability %08x %08x\r\n");

            l5.SetTargetProperties(new object[] { aProcess, aProcess, aProcess.Capabilities, aProcess.Capabilities }, "TempCodeSegAddress", "CodeSegAddress", "HighDWord", "LowDWord");
            //
            ParserLine l6 = ParserLine.NewSymFormat("Id=%d");

            l6.SetTargetProperties(aProcess, "Id");

            para.Add(l1, l2, l3, l4, l5, l6);
            return(para);
        }
Esempio n. 7
0
        private ParserParagraph CreateChunkMultiple(string aName, DChunk aChunk)
        {
            ParserParagraph para = new ParserParagraph(aName);
            //
            ParserLine l1 = ParserLine.NewSymFormat("Owning Process %08x OS ASIDS %08x\r\n");

            l1.SetTargetProperties(aChunk, "OwningProcessAddress", "OSAsids");
            //
            ParserLine l2 = ParserLine.NewSymFormat("Size %x, MaxSize %x, Base %08x\r\n");

            l2.SetTargetProperties(aChunk, "Size", "MaxSize", "Base");
            //
            ParserLine l3 = ParserLine.NewSymFormat("Attrib %x, StartPos %x\r\n");

            l3.SetTargetProperties(aChunk, "Attributes", "StartPos");
            //
            ParserLine l4 = ParserLine.NewSymFormat("Type %d\r\n");

            l4.SetTargetProperty(aChunk, "ChunkType");
            //
            ParserLine l5 = ParserLine.NewSymFormat("PTE: %08x, PDE: %08x\r\n");

            l5.SetTargetProperties(aChunk.Permissions, "Pte", "Pde");
            //
            ParserLine l6 = ParserLine.NewSymFormat("PageTables=%08x, PageBitMap=%08x\r\n");

            l6.SetTargetProperties(aChunk, "PageTables", "PageBitMap");

            para.Add(l1, l2, l3, l4, l5, l6);
            return(para);
        }
Esempio n. 8
0
        private void PrepareMandatoryParagraph()
        {
            ParserParagraph para = new ParserParagraph("FaultInfo");
            //
            ParserLine l1 = ParserLine.NewSymFormat("Fault Category: %S  Fault Reason: %08x\r\n");

            l1.SetTargetProperties(CrashDebugger.InfoFault, "Category", "Reason");
            //
            ParserLine l2 = ParserLine.NewSymFormat("ExcId %08x CodeAddr %08x DataAddr %08x Extra %08x\r\n");

            l2.SetTargetProperties(CrashDebugger.InfoFault, "ExceptionId", "CodeAddress", "DataAddress", "ExtraInfo");
            //
            para.Add(l1, l2);
            ParserEngine.Add(para);
        }
Esempio n. 9
0
        public ParserParagraph CreateMonitorObjectParagraph(string aName, DObject aObject)
        {
            ParserParagraph para = new ParserParagraph(aName);

            // This is a real line that will gather and save information for the client...
            ParserLine l1 = ParserLine.NewSymFormat("%S at %08x VPTR=%08x AccessCount=%d Owner=%08x\r\n");

            l1.SetTargetProperties(aObject, "<dummy>", "KernelAddress", "VTable", "AccessCount", "OwnerAddress");
            l1[0].SetTargetObject();
            //
            ParserLine l2 = ParserLine.NewSymFormat("Full name %S\r\n");

            l2.SetTargetProperties(aObject, "Name");
            //
            para.Add(l1, l2);
            return(para);
        }
Esempio n. 10
0
        private ParserParagraph CreateThreadCommon(string aName, DThread aThread)
        {
            ParserParagraph para = new ParserParagraph(aName);
            //
            ParserLine l1 = ParserLine.NewSymFormat("Default priority %d WaitLink Priority %d\r\n");

            l1.SetTargetProperties(aThread.Priorities, "Default", "WaitLink");
            //
            ParserLine l2 = ParserLine.NewSymFormat("ExitInfo %d,%d,%lS\r\n");

            l2.SetTargetProperties(aThread.ExitInfo, "Type", "Reason", "Category");
            //
            ParserLine l3 = ParserLine.NewSymFormat("Flags %08x, Handles %08x\r\n");

            l3.SetTargetProperties(aThread, "Flags", "Handles");
            //
            ParserLine l4 = ParserLine.NewSymFormat("Supervisor stack base %08x size %x\r\n");

            l4.SetTargetProperties(aThread.StackInfoSupervisor, "BaseAddress", "Size");
            //
            ParserLine l5 = ParserLine.NewSymFormat("User stack base %08x size %x\r\n");

            l5.SetTargetProperties(aThread.StackInfoUser, "BaseAddress", "Size");
            //
            ParserLine l6 = ParserLine.NewSymFormat("Id=%d, Alctr=%08x, Created alctr=%08x, Frame=%08x\r\n");

            l6.SetTargetProperties(new object[] { aThread, aThread.AllocatorInfo, aThread.AllocatorInfo, aThread }, "Id", "Allocator", "CreatedAllocator", "Frame");
            //
            ParserLine l7 = ParserLine.NewSymFormat("Trap handler=%08x, ActiveScheduler=%08x, Exception handler=%08x\r\n");

            l7.SetTargetProperties(aThread.Handlers, "TrapHandler", "ActiveScheduler", "ExceptionHandler");
            //
            ParserLine l8 = ParserLine.NewSymFormat("TempObj=%08x TempAlloc=%08x IpcCount=%08x\r\n");

            l8.SetTargetProperties(new object[] { aThread.Temporaries, aThread.Temporaries, aThread }, "TempObj", "TempAlloc", "IpcCount");
            //
            para.Add(l1, l2, l3, l4, l5, l6, l7, l8);
            return(para);
        }
        private void PrepareMandatoryParagraph()
        {
            {
                SchedulerInfo info = CrashDebugger.InfoScheduler;

                ParserParagraph para = new ParserParagraph("SCHEDULER_INFO");
                //
                ParserLine l1 = ParserLine.NewSymFormat("SCHEDULER @%08x: CurrentThread %08x\r\n");
                l1.SetTargetProperties(info, "Address", "CurrentNThreadAddress");
                //
                ParserLine l2 = ParserLine.NewSymFormat("RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n");
                l2.SetTargetProperties(info, "RescheduleNeeded", "DfcPending", "KernCSLocked");
                //
                ParserLine l3 = ParserLine.NewSymFormat("DFCS: next %08x prev %08x\r\n");
                l3.SetTargetProperties(info.DFCs, "Next", "Previous");
                //
                ParserLine l4 = ParserLine.NewSymFormat("ProcessHandler=%08x, AddressSpace=%08x\r\n");
                l4.SetTargetProperties(info, "ProcessHandlerAddress", "AddressSpace");
                //
                ParserLine l5 = ParserLine.NewSymFormat("SYSLOCK: HoldingThread %08x iWaiting %08x\r\n");
                l5.SetTargetProperties(info.SysLockInfo, "HoldingThreadAddress", "WaitingThreadAddress");
                //
                ParserLine l6 = ParserLine.NewSymFormat("Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n");
                l6.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                ParserLine l7 = ParserLine.NewSymFormat("Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n");
                l7.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                ParserLine l8 = ParserLine.NewSymFormat("Extras 8: %08x 9: %08x A: %08x B: %08x\r\n");
                l8.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                ParserLine l9 = ParserLine.NewSymFormat("Extras C: %08x D: %08x E: %08x F: %08x\r\n");
                l9.SetTargetMethod(info.ExtraRegisters, "Add");
                //
                para.Add(l1, l2, l3, l4, l5, l6, l7, l8, l9);
                ParserEngine.Add(para);
            }
        }