void CodeSegmentLineComplete(ParserElementBase aElement)
        {
            System.Diagnostics.Debug.Assert(iCurrentThread != null);
            ParserLine line = (ParserLine)aElement;
            //
            int    index          = line[0].AsInt;
            int    count          = line[1].AsInt;
            uint   codeSegAddress = line[2].AsUint;
            uint   startAddress   = line[3].AsUint;
            uint   endAddress     = line[4].AsUint;
            string fileName       = line[5].AsString;
            //
            DProcess process = iCurrentThread.OwningProcess;

            if (process != null)
            {
                ProcessCodeSegCollection codeSegs = process.CodeSegments;
                ProcessCodeSeg           codeSeg  = codeSegs[codeSegAddress];
                //
                if (codeSeg == null)
                {
                    // The code seg is not directly part of the process handle list
                    // but it is some how mapped into the process?
                    //
                    // Try looking up the underlying code seg entry details from
                    // the crash debugger data itself. It should be part of the code
                    // seg listing so this should always work.
                    codeSeg = new ProcessCodeSeg(CrashDebugger, codeSegAddress, 0);
                    process.CodeSegments.Add(codeSeg);
                }
                //
                codeSeg.ProcessLocalRunAddress = startAddress;
                codeSeg.Size = (endAddress - startAddress);
            }
            //
            int remaining = count - index;

            if (remaining == 0)
            {
                // Queue up stack data...
                iHelperStack.CreateStackParagraphs(ParserEngine, iCurrentThread);
            }
            else
            {
                // So that we capture the next line
                aElement.SetRepetitions(1);
            }
        }
示例#2
0
        public void AddCodeSegToProcess(ParserParagraph aParagraph, ParserFieldName aParameterName, uint aParameterValue)
        {
            System.Diagnostics.Debug.Assert(aParagraph.Tag is DProcess);
            DProcess process = (DProcess)aParagraph.Tag;
            ProcessCodeSegCollection codeSegs = process.CodeSegments;

            //
            if (aParameterName == "lib")
            {
                int count = codeSegs.Count;
                if (count > 0)
                {
                    ProcessCodeSeg lastEntry = codeSegs[count - 1];
                    lastEntry.LibraryAddress = aParameterValue;
                }
            }
            else if (aParameterName == "seg")
            {
                ProcessCodeSeg entry = new ProcessCodeSeg(process.CrashDebugger);
                entry.CodeSegAddress = aParameterValue;
                codeSegs.Add(entry);
            }
        }