private static void WriteDevice(XmlWriter aOutput, CXmlDataBlock datablock)
        {
            // Device
            aOutput.WriteStartElement(XmlConsts.Kxml_device);

            if (datablock.Platform().Equals(XmlConsts.Kxml_sos))
            {
                aOutput.WriteAttributeString(XmlConsts.Kxml_platform, XmlConsts.Kxml_s60);
            }
            else
            {
                aOutput.WriteAttributeString(XmlConsts.Kxml_platform, datablock.Platform());
            }

            aOutput.WriteAttributeString(XmlConsts.Kxml_code, datablock.ProductType());
            aOutput.WriteAttributeString(XmlConsts.Kxml_version, datablock.SWVersion());

            if (datablock.RomId() != null)
            {
                aOutput.WriteAttributeString(XmlConsts.Kxml_romid, datablock.RomId().ToString());
            }

            // variant is not written.

            if (datablock.Imei() != string.Empty)
            {
                aOutput.WriteAttributeString(XmlConsts.Kxml_imei, datablock.Imei());
            }

            // Write additional device details here if exist.

            aOutput.WriteEndElement();
        }
示例#2
0
        /**
         * Writes one datablock as plain text.
         */
        private static void WriteDataBlock(StreamWriter writer, CXmlDataBlock datablock)
        {
            writer.Write(PrettyTitle(KTitleCrashFile));

            // Device
            if (datablock.Platform().Equals(XmlConsts.Kxml_sos))
            {
                writer.Write(PrettyString(XmlConsts.Kxml_platform, XmlConsts.Kxml_s60));
            }
            else
            {
                writer.Write(PrettyString(XmlConsts.Kxml_platform, datablock.Platform()));
            }

            writer.Write(PrettyString(XmlConsts.Kxml_code, datablock.ProductType()));
            writer.Write(PrettyString(XmlConsts.Kxml_version, datablock.SWVersion()));

            if (datablock.RomId() != null)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_romid, "0x" + datablock.RomId().Value.ToString("X8")));
            }

            // variant is not written.

            if (datablock.Imei() != string.Empty)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_imei, datablock.Imei()));
            }

            writer.Write(PrettyString(XmlConsts.Kxml_timestamp, datablock.TimeStampText()));

            string crashtypestr = "Not found";

            if (datablock.FileType() == XmlConsts.MobileCrashFileType.ETypeBasicCrash)
            {
                crashtypestr = XmlConsts.Kxml_type_crash;
            }
            else if (datablock.FileType() == XmlConsts.MobileCrashFileType.ETypeAliveMessage)
            {
                crashtypestr = XmlConsts.Kxml_type_alivemsg;
            }
            else if (datablock.FileType() == XmlConsts.MobileCrashFileType.ETypeCrashAPIReport)
            {
                crashtypestr = XmlConsts.Kxml_type_report;
            }
            else if (datablock.FileType() == XmlConsts.MobileCrashFileType.ETypeRegistrationMessage)
            {
                crashtypestr = XmlConsts.Kxml_type_regmsg;
            }

            writer.Write(PrettyString(XmlConsts.Kxml_type, crashtypestr));

            writer.Write(PrettyString(XmlConsts.Kxml_file_name, datablock.BinFilename()));

            if (crashtypestr.Equals(XmlConsts.Kxml_type_report))
            {
                writer.Write(PrettyString(XmlConsts.Kxml_report_category, datablock.ReportCategory()));
            }

            if (crashtypestr.Equals(XmlConsts.Kxml_type_report))
            {
                writer.Write(PrettyString(XmlConsts.Kxml_report_type, datablock.ReportType()));
            }

            if (datablock.CrashedModuleName() != string.Empty)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_crashed_module, datablock.CrashedModuleName()));
            }

            if (datablock.Hash() != string.Empty)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_defect_hash, datablock.Hash()));
            }

            if (datablock.DetailedHash() != string.Empty)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_detailed_defect_hash, datablock.DetailedHash()));
            }

            if (datablock.TestSet() != string.Empty)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_testset, datablock.TestSet()));
            }

            WriteDictionaryValues(writer, datablock);

            // Codesegments
            if (datablock.CodeSegs().Count > 0)
            {
                writer.Write(PrettyTitle(KTitleCodesegments));
            }

            foreach (CXmlCodeSegItem codeseg in datablock.CodeSegs())
            {
                string range = "0x" + codeseg.Start.ToString("X8") + " - " + "0x" + codeseg.End.ToString("x8");
                writer.WriteLine(range + FillSpaces(range) + codeseg.Name);
            }

            // Registers
            if (datablock.RegStorage().BasicRegs().ToPrettyString().Length > 0 ||
                datablock.RegStorage().OtherRegLists().Count > 0)
            {
                writer.Write(PrettyTitle(KTitleRegisters));
            }
            writer.WriteLine(datablock.RegStorage().BasicRegs().ToPrettyString());

            // Extra registers
            foreach (CXmlRegisterStorage.CCrashInfoRegisterList registerList in datablock.RegStorage().OtherRegLists())
            {
                writer.WriteLine(registerList.ToPrettyString());
            }

            // Call stacks
            if (datablock.CallStacks().Count > 0)
            {
                writer.Write(PrettyTitle(KTitleCallStacks));
            }

            foreach (XmlFilePlugin.FileFormat.CXmlCallStack stack in datablock.CallStacks())
            {
                writer.WriteLine(stack.ToString());
            }

            // OST traces
            if (datablock.OstTraces().Count > 0)
            {
                writer.Write(PrettyTitle(KTitleOstTraces));
            }

            foreach (string line in datablock.OstTraces())
            {
                writer.WriteLine(line);
            }

            // Event log
            if (datablock.Eventlog().Count > 0)
            {
                writer.Write(PrettyTitle(KTitleEventLog));
            }

            foreach (string line in datablock.Eventlog())
            {
                writer.WriteLine(line);
            }
        }