|
From: <sv...@va...> - 2005-11-14 17:01:14
|
Author: sewardj
Date: 2005-11-14 17:01:01 +0000 (Mon, 14 Nov 2005)
New Revision: 5130
Log:
In XML mode, emit a closing </valgrindoutput> on various kinds of
failures, so as to help parsers stop parsing:
- after any kind of assertion failure or panic
- if suppression file is missing or has a syntax error
Modified:
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_libcassert.c
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-11-14 16:00:27 UTC (rev 5129)
+++ trunk/coregrind/m_errormgr.c 2005-11-14 17:01:01 UTC (rev 5130)
@@ -910,6 +910,8 @@
fd =3D -1;
sres =3D VG_(open)( filename, VKI_O_RDONLY, 0 );
if (sres.isError) {
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
VG_(message)(Vg_UserMsg, "FATAL: can't open suppressions file '%s'=
",=20
filename );
VG_(exit)(1);
@@ -1038,6 +1040,8 @@
return;
=20
syntax_error:
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
VG_(message)(Vg_UserMsg,=20
"FATAL: in suppressions file '%s': %s", filename, err_st=
r );
=20
Modified: trunk/coregrind/m_libcassert.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_libcassert.c 2005-11-14 16:00:27 UTC (rev 5129)
+++ trunk/coregrind/m_libcassert.c 2005-11-14 17:01:01 UTC (rev 5130)
@@ -37,6 +37,7 @@
#include "pub_core_stacktrace.h"
#include "pub_core_syscall.h"
#include "pub_core_tooliface.h" // For VG_(details).{name,bug_report=
s_to}
+#include "pub_core_options.h" // For VG_(clo_xml)
#include "vki_unistd.h"
=20
/* ---------------------------------------------------------------------
@@ -167,6 +168,9 @@
bugs_to =3D VG_(details).bug_reports_to;
}
=20
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
+
// Treat vg_assert2(0, "foo") specially, as a panicky abort
if (VG_STREQ(expr, "0")) {
VG_(printf)("\n%s: %s:%d (%s): the 'impossible' happened.\n",
@@ -185,6 +189,8 @@
static void panic ( Char* name, Char* report, Char* str,
Addr ip, Addr sp, Addr fp, Addr lr )
{
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str);
report_and_quit(report, ip, sp, fp, lr);
}
@@ -207,6 +213,8 @@
/* Print some helpful-ish text about unimplemented things, and give up. =
*/
void VG_(unimplemented) ( Char* msg )
{
+ if (VG_(clo_xml))
+ VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg,=20
"Valgrind detected that your program requires");
|