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); }
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); }
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 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); }