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); }
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); }
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); }
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); }
private void CreateRegisterParagraphs(ParserEngine aEngine, NThread aThread, ParserElementBase.ElementCompleteHandler aLastFieldHandler) { { ParserParagraph para = new ParserParagraph("NTHREAD_REGS1"); para.SetTargetMethod(aThread.Registers, "Add"); ParserLine l1 = ParserLine.NewSymFormat("FPEXC %08x\r\n"); ParserLine l2 = ParserLine.NewSymFormat("CAR %08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat("DACR %08x\r\n"); para.Add(l1, l2, l3); aEngine.Add(para); } { ParserParagraph para = new ParserParagraph("NTHREAD_REGS2"); para.SetTargetMethod(aThread.Registers, "Add"); ParserLine l1 = ParserLine.NewSymFormat("R13_USR %08x R14_USR %08x SPSR_SVC %08x\r\n"); ParserLine l2 = ParserLine.NewSymFormat(" R4 %08x R5 %08x R6 %08x R7 %08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat(" R8 %08x R9 %08x R10 %08x R11 %08x\r\n"); ParserLine l4 = ParserLine.NewSymFormat(" PC %08x\r\n"); // if (aLastFieldHandler != null) { l4[0].ElementComplete += new ParserElementBase.ElementCompleteHandler(aLastFieldHandler); } // para.Add(l1, l2, l3, l4); aEngine.Add(para); } }
public static void RegisterCommands(ParserEngine aEngine) { CreateDictionary(); // foreach (KeyValuePair <TState, TStateMapplet> keyVP in iDictionary) { string[] commandIds = keyVP.Value.CommandIdentifiers; foreach (string commandId in commandIds) { // Create paragraph and associate the state type with the tag so that // we know what type of object to create later on when the line fires. ParserParagraph command = new ParserParagraph(commandId); command.Tag = keyVP.Key; // Create line to match ParserLine line = ParserLine.New(commandId); // Make sure that the paragraph and line don't disable themselves whenever // they see a matching line. Some of these objects are needed more than once! command.DisableWhenComplete = false; line.DisableWhenComplete = false; // command.Add(line); aEngine.Add(command); } } }
private void CreateThreadMState(ParserParagraph aParagraph, DThread.TThreadState aState, string aMStateName, bool aCapturesWaitObject) { StringBuilder format = new StringBuilder("Thread MState"); format.Append(" " + aMStateName); // if (aCapturesWaitObject) { format.Append(" %8x"); } // string finalFormat = format.ToString(); ParserLine l1 = null; // if (aCapturesWaitObject) { l1 = ParserLine.NewSymFormat(finalFormat); } else { l1 = ParserLine.New(finalFormat); } l1.Tag = aState; l1.ElementComplete += new ParserElementBase.ElementCompleteHandler(ThreadMState_ElementComplete); // if (aCapturesWaitObject) { l1[0].SetTargetMethod(this, "SetThreadMStateWaitObject"); } // aParagraph.Add(l1); }
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); }
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); }
public void SetCustomPointer(string aPrefix) { // Find any existing custom entry and remove it int paraCount = iPrefixEngine_Pointer.Count; System.Diagnostics.Debug.Assert(paraCount >= 1); if (paraCount > 1) { iPrefixEngine_Pointer.RemoveRange(1); } string prefixText = aPrefix.Trim(); if (prefixText != string.Empty) { ParserParagraph para = new ParserParagraph("Dynamic_Pointer"); // prefixText += "%08x"; // ParserLine l1 = ParserLine.NewSymFormat(prefixText); l1.SetTargetProperty(iEngine.AddressInfo, "Pointer"); para.Add(l1); iPrefixEngine_Pointer.Add(para); } }
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); } }
private void CreateThreadNState(ParserParagraph aParagraph, NThread aThread, string aNStateName, bool aCapturesWaitObject) { StringBuilder format = new StringBuilder("NThread @ %8x Pri %d NState " + aNStateName); // if (aCapturesWaitObject) { format.Append(" %8x"); } format.Append("\r\n"); // // string finalFormat = format.ToString(); NThread.TNThreadState state = NThread.NStateFromString(aNStateName); ParserLine l1 = ParserLine.NewSymFormat(finalFormat); l1.Tag = state; // l1[0].SetTargetProperty(aThread, "Address"); l1[1].SetTargetProperty(aThread, "Priority"); // if (aCapturesWaitObject) { l1[2].SetTargetMethod(this, "SetThreadNStateWaitObject"); } // l1.ElementComplete += new ParserElementBase.ElementCompleteHandler(NThreadState_ElementComplete); aParagraph.Add(l1); }
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); }
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 PrepareEntryParser() { ParserParagraph para = new ParserParagraph("CODE SEGS"); // ParserLine l1 = ParserLine.NewSymFormat("\r\nCodeSeg at %08x:\r\n"); ParserLine l2 = ParserLine.NewSymFormat(" FileName: %S\r\n"); ParserLine l3 = ParserLine.NewSymFormat(" RunAddress: %08x\r\n"); para.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler(ParagraphComplete); // para.Add(l1, l2, l3); 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); }
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); }
public override void Prepare() { DObjectCon container = CrashDebugger.ContainerByType(DObject.TObjectType.EProcess); // ParserLine l1 = ParserLine.NewSymFormat("Container %d at %08x contains %d %S:\r\n"); l1[0].SetTargetProperty(container, "Index"); l1[1].SetTargetProperty(container, "KernelAddress"); l1[2].SetTargetProperty(container, "ExpectedCount"); l1.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler(HeaderLine_ElementComplete); // ParserParagraph para = new ParserParagraph("CONTAINER [" + container.TypeDescription + "]"); para.Add(l1); ParserEngine.Add(para); }
private void PrepareMandatoryParagraph() { ParserParagraph para = new ParserParagraph("Debug_Mask_Info"); // ParserLine l1 = ParserLine.NewSymFormat("DebugMask[0] = %08x\r\n"); ParserLine l2 = ParserLine.NewSymFormat("DebugMask[1] = %08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat("DebugMask[2] = %08x\r\n"); ParserLine l4 = ParserLine.NewSymFormat("DebugMask[3] = %08x\r\n"); ParserLine l5 = ParserLine.NewSymFormat("DebugMask[4] = %08x\r\n"); ParserLine l6 = ParserLine.NewSymFormat("DebugMask[5] = %08x\r\n"); ParserLine l7 = ParserLine.NewSymFormat("DebugMask[6] = %08x\r\n"); ParserLine l8 = ParserLine.NewSymFormat("DebugMask[7] = %08x\r\n"); para.Add(l1, l2, l3, l4, l5, l6, l7, l8); ParserEngine.Add(para); }
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); }
private void SetThreadAddress(uint aAddress) { // Look for the thread which we're about to process... iCurrentThread = CrashDebugger.ThreadByAddress(aAddress); if (iCurrentThread != null) { // Next we must start to process code segments for this // thread. These lines contain additional information about // the run address of the code segments, relative to the process. ParserParagraph para = new ParserParagraph("STACK_THREAD_INFO_CODESEGS"); // ParserLine l1 = ParserLine.NewSymFormat("CodeSeg[%03d/%03d] @ %08x - %08X-%08X %S"); l1.ElementComplete += new ParserElementBase.ElementCompleteHandler(CodeSegmentLineComplete); // para.Add(l1); ParserEngine.Add(para); } }
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 PrepareOptionalParagraph() { ParserParagraph para = new ParserParagraph("CpuFaultInfo"); para.SetTargetMethod(CrashDebugger.InfoFault.Registers, "Add", TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsString, TValueStoreMethodArguments.EValueStoreMethodArgumentValue); // ParserLine l1 = ParserLine.NewSymFormat("Exc %1d Cpsr=%08x FAR=%08x FSR=%08x\r\n"); l1[0].SetTargetProperties(CrashDebugger.InfoFault, "ExcCode"); // ParserLine l2 = ParserLine.NewSymFormat(" R0=%08x R1=%08x R2=%08x R3=%08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat(" R4=%08x R5=%08x R6=%08x R7=%08x\r\n"); ParserLine l4 = ParserLine.NewSymFormat(" R8=%08x R9=%08x R10=%08x R11=%08x\r\n"); ParserLine l5 = ParserLine.NewSymFormat("R12=%08x R13=%08x R14=%08x R15=%08x\r\n"); ParserLine l6 = ParserLine.NewSymFormat("R13Svc=%08x R14Svc=%08x SpsrSvc=%08x\r\n"); // para.Add(l1, l2, l3, l4, l5, l6); ParserEngine.Add(para); }
public ParserParagraph CreateEntryDetector(string aObjectName, ParserElementBase.ElementCompleteHandler aNewEntryHandler) { ParserParagraph para = new ParserParagraph("MONITOR_ENTRY_DETECTOR"); // If the "new entry handler" object is utilised, the client wishes to detect when a new entry is created. // This detection will act as a transient call-back to the client - and won't be used to gather any specific // information besides that a new entry has been detected. Furthermore, the entry will be non-consuming and // dequeue itself once it "fires" since it's purpose has then been served. if (aNewEntryHandler == null) { throw new ArgumentException("aNewEntryHandler cannot be NULL"); } ParserLine newEntryLine = ParserLine.NewSymFormat(aObjectName.ToUpper() + " at %08x VPTR=%08x AccessCount=%d Owner=%08x\r\n"); newEntryLine.ElementComplete += new ParserElementBase.ElementCompleteHandler(aNewEntryHandler); newEntryLine.DequeueIfComplete = true; newEntryLine.NeverConsumesLine = true; para.Add(newEntryLine); return(para); }
private void PreparePrefixes_Pointer() { ParserParagraph para = new ParserParagraph("Fixed_Pointer"); // ParserLine l1 = ParserLine.NewSymFormat("CurrentSP - 0x%08x"); l1.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l2 = ParserLine.NewSymFormat("CurrentSP - %08x"); l2.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l3 = ParserLine.NewSymFormat("CurrentSP: 0x%08x"); l3.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l4 = ParserLine.NewSymFormat("CurrentSP: %08x"); l4.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l5 = ParserLine.NewSymFormat("r12=%08x %08x %08x %08x"); l5[1].SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l6 = ParserLine.NewSymFormat("Current stack pointer: 0x%08x"); l6.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l7 = ParserLine.NewSymFormat("sp: 0x%08x"); l7.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // ParserLine l8 = ParserLine.NewSymFormat("sp: %08x"); l8.SetTargetProperty(iEngine.AddressInfo, "Pointer"); // para.Add(l1, l2, l3, l4, l5, l6, l7, l8); // iPrefixEngine_Pointer.Add(para); }
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); }
public override void Prepare() { ParserParagraph para = new ParserParagraph("USERCONTEXTTABLE_INFO"); // The format of the actual entry specification is the same for each // line StringBuilder lineFormat = new StringBuilder( ); int count = UserContextTable.EntryCount; for (int i = 0; i < count; i++) { lineFormat.Append("[%02x, %02x]"); } // Create one line per table int tableCount = CrashDebugger.UserContextTableManager.Count; for (int i = 0; i < tableCount; i++) { // Create line based upon dynamic format string string format = String.Format(KTablePrefixFormat, i, lineFormat.ToString()); ParserLine line = ParserLine.NewSymFormat(format); // Save the context table type - we need this in the callback later on line.Tag = (TUserContextType)i; // Make sure each field stores it's value internally, so that we can extract it // ourselves in the callback. line.SetTargetObject(); // Get a callback when all fields are ready. line.ElementComplete += new ParserElementBase.ElementCompleteHandler(LineComplete); para.Add(line); } ParserEngine.Add(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); } }
private void PrepareMandatoryParagraph() { { ParserParagraph para = CreateParagraph("MODE_USR:"******" R0=%08x R1=%08x R2=%08x R3=%08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat(" R4=%08x R5=%08x R6=%08x R7=%08x\r\n"); ParserLine l4 = ParserLine.NewSymFormat(" R8=%08x R9=%08x R10=%08x R11=%08x\r\n"); ParserLine l5 = ParserLine.NewSymFormat("R12=%08x R13=%08x R14=%08x R15=%08x\r\n"); para.Add(l2, l3, l4, l5); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph(string.Empty, RegisterCollection.TType.ETypeCommonBank); ParserLine l2 = ParserLine.NewSymFormat("CPSR=%08x\r\n"); para.Add(l2); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph("MODE_FIQ:", RegisterCollection.TType.ETypeFastInterrupt); // ParserLine l2 = ParserLine.NewSymFormat(" R8=%08x R9=%08x R10=%08x R11=%08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat("R12=%08x R13=%08x R14=%08x SPSR=%08x\r\n"); para.Add(l2, l3); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph("MODE_IRQ:", RegisterCollection.TType.ETypeInterrupt); ParserLine l2 = ParserLine.NewSymFormat("R13=%08x R14=%08x SPSR=%08x\r\n"); para.Add(l2); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph("MODE_SVC:", RegisterCollection.TType.ETypeSupervisor); ParserLine l2 = ParserLine.NewSymFormat("R13=%08x R14=%08x SPSR=%08x\r\n"); para.Add(l2); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph("MODE_ABT:", RegisterCollection.TType.ETypeAbort); ParserLine l2 = ParserLine.NewSymFormat("R13=%08x R14=%08x SPSR=%08x\r\n"); para.Add(l2); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph("MODE_UND:", RegisterCollection.TType.ETypeUndefined); ParserLine l2 = ParserLine.NewSymFormat("R13=%08x R14=%08x SPSR=%08x\r\n"); para.Add(l2); ParserEngine.Add(para); } { ParserParagraph para = CreateParagraph(string.Empty, RegisterCollection.TType.ETypeGeneral); ParserLine l2 = ParserLine.NewSymFormat("DACR %08x\r\n"); ParserLine l3 = ParserLine.NewSymFormat("CAR %08x\r\n"); ParserLine l4 = ParserLine.NewSymFormat("MMUID %08x\r\n"); ParserLine l5 = ParserLine.NewSymFormat("MMUCR %08x\r\n"); ParserLine l6 = ParserLine.NewSymFormat("AUXCR %08x\r\n"); ParserLine l7 = ParserLine.NewSymFormat("FPEXC %08x\r\n"); ParserLine l8 = ParserLine.NewSymFormat("CTYPE %08x\r\n"); para.Add(l2, l3, l4, l5, l6, l7, l8); ParserEngine.Add(para); } }