private void XmlSerializeRegisters(CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters) { // Must obtain the registers in advance to avoid creating an empty list. List <CIRegisterList> regs = new List <CIRegisterList>(); // Find register lists CIElementList <CIRegisterListCollection> allRegs = iThread.ChildrenByType <CIRegisterListCollection>(); foreach (CIRegisterListCollection registerListCol in allRegs) { foreach (CIRegisterList registerList in registerListCol) { if (registerList.Count > 0) { regs.Add(registerList); } } } // Only write something if we have some entries if (regs.Count > 0) { CXmlNode.WriteLinkListStart(aParameters.Writer, SegConstants.Registers); foreach (CIRegisterList registerList in regs) { CXmlNode.WriteLink(registerList.Id, SegConstants.Registers, aParameters.Writer); } CXmlNode.WriteLinkListEnd(aParameters.Writer); } }
private void XmlSerializeStacks(CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters) { // Find stacks CIElementList <CIStack> stacks = iThread.ChildrenByType <CIStack>(); // Only write something if we have some entries if (stacks.Count > 0) { CXmlNode.WriteLinkListStart(aParameters.Writer, SegConstants.Stacks); foreach (CIStack item in stacks) { CXmlNode.WriteLink(item.Id, SegConstants.Stacks, aParameters.Writer); } CXmlNode.WriteLinkListEnd(aParameters.Writer); } }
protected override void XmlSerializeChildren(CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters) { // Stacks CXmlNode.WriteLinkListStart(aParameters.Writer, SegConstants.Threads); foreach (CIThread thread in iProcess.Threads) { CXmlNode.WriteLink(thread.Id, SegConstants.Threads, aParameters.Writer); } CXmlNode.WriteLinkListEnd(aParameters.Writer); // Code segments CXmlNode.WriteLinkListStart(aParameters.Writer, SegConstants.CodeSegs); foreach (CICodeSeg codeSeg in iProcess.CodeSegments) { CXmlNode.WriteLink(codeSeg.Id, SegConstants.CodeSegs, aParameters.Writer); } CXmlNode.WriteLinkListEnd(aParameters.Writer); }