First pass at adding ability for Memcheck to print all output in XML

form.  The relevant flag is --xml=yes.  Currently this only works with
Memcheck.

Specifying this flag fixes various other options relating to verbosity
and behaviour of the leak checker, so that the resulting output is in
a relatively fixed form suitable for parsing by GUIs.

Still to do:

* Add mechanism to show error counts
* Add regression test
* Document the resulting format



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3773
This commit is contained in:
Julian Seward
2005-05-19 00:25:45 +00:00
parent efe555f4fa
commit 161cfde150
12 changed files with 394 additions and 113 deletions

View File

@@ -191,14 +191,26 @@ static void printIpDesc(UInt n, Addr ip)
static UChar buf[VG_ERRTXT_LEN];
VG_(describe_IP)(ip, buf, VG_ERRTXT_LEN);
VG_(message)(Vg_UserMsg, " %s %s", ( n == 0 ? "at" : "by" ), buf);
if (VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, " %s", buf);
} else {
VG_(message)(Vg_UserMsg, " %s %s", ( n == 0 ? "at" : "by" ), buf);
}
}
/* Print a StackTrace. */
void VG_(pp_StackTrace) ( StackTrace ips, UInt n_ips )
{
vg_assert( n_ips > 0 );
if (VG_(clo_xml))
VG_(message)(Vg_UserMsg, " <stack>");
VG_(apply_StackTrace)( printIpDesc, ips, n_ips );
if (VG_(clo_xml))
VG_(message)(Vg_UserMsg, " </stack>");
}
/* Get and immediately print a StackTrace. */