public void SetCustomCodeSegment(string aPrefix)
        {
            // Find any existing custom entry and remove it
            int paraCount = iPrefixEngine_CodeSegment.Count;

            System.Diagnostics.Debug.Assert(paraCount >= 1);
            if (paraCount > 1)
            {
                iPrefixEngine_CodeSegment.RemoveRange(1);
            }

            string prefixText = aPrefix.Trim();

            if (prefixText != string.Empty)
            {
                ParserParagraph para = new ParserParagraph("Dynamic_CodeSegment");
                //
                prefixText += "%08x-%08x %S";
                //
                ParserLine l1 = ParserLine.NewSymFormat(prefixText);
                l1.SetTargetMethod(this, "TryToParseCodeSegment");
                l1.DisableWhenComplete = false;
                para.Add(l1);
                para.DisableWhenComplete = false;
                iPrefixEngine_CodeSegment.Add(para);
            }
        }
Exemplo 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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public override void Prepare()
        {
            // First, we need to know which thread we're dealing with
            // so that means we must look for the thread info
            ParserParagraph para = new ParserParagraph("STACK_THREAD_INFO");
            //
            ParserLine l1 = ParserLine.NewSymFormat("STACK DATA for thread at %8x");

            l1.SetTargetMethod(this, "SetThreadAddress");
            para.Add(l1);
            ParserEngine.Add(para);
        }
        private void PreparePrefixes_CodeSegment()
        {
            ParserParagraph para = new ParserParagraph("Fixed_CodeSegment");
            //
            ParserLine l1 = ParserLine.NewSymFormat("%08x-%08x %S");

            l1.SetTargetMethod(this, "TryToParseCodeSegment");
            l1.DisableWhenComplete = false;
            //
            para.Add(l1);
            para.DisableWhenComplete = false;
            //
            iPrefixEngine_CodeSegment.Add(para);
        }
Exemplo n.º 7
0
        private ParserParagraph CreateParagraph(string aName, RegisterCollection.TType aType)
        {
            RegisterCollection registers = CrashDebugger.InfoCpu[aType];
            //
            ParserParagraph para = new ParserParagraph(aName);

            para.Tag = aType;
            para.SetTargetMethod(this, "AddRegister");
            //
            if (aName.Length > 0)
            {
                ParserLine header = ParserLine.New(aName + "\r\n");
                header.SetTargetMethod(this, "SwitchBank");
            }
            return(para);
        }
Exemplo n.º 8
0
        private ParserParagraph CreateMonitorProcessCodeSegs(string aName, DProcess aProcess)
        {
            ParserParagraph para = new ParserParagraph(aName);

            para.Tag = aProcess;

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

            l2[0].SetTargetObject();
            l2.SetTargetMethod(this, "AddCodeSegToProcess");

            // Loop header
            ParserLine l1 = ParserLine.NewSymFormat("CodeSegs: Count=%d\r\n");

            l1.SetTargetMethod(l2, "SetRepetitions");

            para.Add(l1, l2);
            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);
            }
        }