|
From: <sv...@va...> - 2005-06-01 17:35:28
|
Author: sewardj
Date: 2005-06-01 18:35:23 +0100 (Wed, 01 Jun 2005)
New Revision: 3837
Modified:
trunk/README_XML_OUTPUT.txt
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_main.c
Log:
Minor refinements/bug-fixes to XML printing.
Modified: trunk/README_XML_OUTPUT.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/README_XML_OUTPUT.txt 2005-06-01 04:07:56 UTC (rev 3836)
+++ trunk/README_XML_OUTPUT.txt 2005-06-01 17:35:23 UTC (rev 3837)
@@ -86,6 +86,7 @@
created by future versions of Valgrind merely by observing that the
protocol version is one they don't understand. Hence TOPLEVEL is:
=20
+ <?xml version=3D"1.0"?>
<valgrindoutput>
<protocolversion>INT<protocolversion>
VERSION1STUFF
@@ -117,12 +118,11 @@
=20
<tool>TEXT</tool>
=20
-* The program and args being run. Note, the program name is not
- distinguished; it is merely the first presented TEXT:
+* The program and args being run.
=20
<argv>
- <arg>TEXT</arg>
- (one or more of)
+ <exe>TEXT</exe>
+ <arg>TEXT</arg> (zero or more of)
</argv>
=20
* The following, indicating that the program has now started:
Modified: trunk/coregrind/m_debuginfo/symtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/symtab.c 2005-06-01 04:07:56 UTC (rev 383=
6)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-01 17:35:23 UTC (rev 383=
7)
@@ -2448,29 +2448,39 @@
=20
if (VG_(clo_xml)) {
=20
+ Bool human_readable =3D True;
+ HChar* maybe_newline =3D human_readable ? "\n " : "";
+ HChar* maybe_newline2 =3D human_readable ? "\n " : "";
+
/* Print in XML format, dumping in as much info as we know. */
APPEND("<frame>");
VG_(sprintf)(ibuf,"<ip>0x%llx</ip>", (ULong)eip);
+ APPEND(maybe_newline);
APPEND(ibuf);
if (know_objname) {
+ APPEND(maybe_newline);
APPEND("<obj>");
APPEND(buf_obj);
APPEND("</obj>");
}
if (know_fnname) {
+ APPEND(maybe_newline);
APPEND("<fn>");
APPEND(buf_fn);
APPEND("</fn>");
}
if (know_srcloc) {
+ APPEND(maybe_newline);
APPEND("<file>");
APPEND(buf_srcloc);
APPEND("</file>");
+ APPEND(maybe_newline);
APPEND("<line>");
VG_(sprintf)(ibuf,"%d",lineno);
APPEND(ibuf);
APPEND("</line>");
}
+ APPEND(maybe_newline2);
APPEND("</frame>");
=20
} else {
Modified: trunk/coregrind/m_errormgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_errormgr.c 2005-06-01 04:07:56 UTC (rev 3836)
+++ trunk/coregrind/m_errormgr.c 2005-06-01 17:35:23 UTC (rev 3837)
@@ -660,7 +660,10 @@
any_supp =3D True;
if (VG_(clo_xml)) {
VG_(message)(Vg_DebugMsg,=20
- " <pair><count>%d</count><name>%s</name></pair>",=
=20
+ " <pair>\n"
+ " <count>%d</count>\n"
+ " <name>%s</name>\n"
+ " </pair>",=20
su->count, su->sname);
} else {
VG_(message)(Vg_DebugMsg, "supp: %4d %s", su->count, su->sname)=
;
@@ -668,7 +671,7 @@
}
=20
if (VG_(clo_xml))
- VG_(message)(Vg_DebugMsg, "<suppcounts>");
+ VG_(message)(Vg_DebugMsg, "</suppcounts>");
=20
return any_supp;
}
@@ -772,8 +775,8 @@
if (err->count <=3D 0)
continue;
VG_(message)(
- Vg_UserMsg, " <pair><count>%d</count>"
- "<unique>0x%llx</unique></pair>",
+ Vg_UserMsg, " <pair> <count>%d</count> "
+ "<unique>0x%llx</unique> </pair>",
err->count, Ptr_to_ULong(err)
);
}
Modified: trunk/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_main.c 2005-06-01 04:07:56 UTC (rev 3836)
+++ trunk/coregrind/m_main.c 2005-06-01 17:35:23 UTC (rev 3837)
@@ -1924,6 +1924,8 @@
=20
if (VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, "");
+ VG_(message)(Vg_UserMsg, "<?xml version=3D\"1.0\"?>");
+ VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<valgrindoutput>");
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<protocolversion>1</protocolversion>");
@@ -1977,8 +1979,11 @@
VG_(message)(Vg_UserMsg, "<tool>%s</tool>", toolname);
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<argv>"); =20
- for (i =3D 0; i < VG_(client_argc); i++)=20
- VG_(message)(Vg_UserMsg, " <arg>%s</arg>", VG_(client_argv)[i]=
);
+ for (i =3D 0; i < VG_(client_argc); i++) {
+ HChar* tag =3D i=3D=3D0 ? "exe" : "arg";
+ VG_(message)(Vg_UserMsg, " <%s>%s</%s>",=20
+ tag, VG_(client_argv)[i], tag);
+ }
VG_(message)(Vg_UserMsg, "</argv>"); =20
}
=20
|