]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
In XML mode, emit a closing </valgrindoutput> on various kinds of
authorJulian Seward <jseward@acm.org>
Mon, 14 Nov 2005 17:01:01 +0000 (17:01 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 14 Nov 2005 17:01:01 +0000 (17:01 +0000)
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

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5130

coregrind/m_errormgr.c
coregrind/m_libcassert.c

index c06a5091d7685f0abfcf2136a2b8646ac03ed899..a5fd02d9592aef83619e70c333be911c7a29e560 100644 (file)
@@ -910,6 +910,8 @@ static void load_one_suppressions_file ( Char* filename )
    fd   = -1;
    sres = 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'", 
                    filename );
       VG_(exit)(1);
@@ -1038,6 +1040,8 @@ static void load_one_suppressions_file ( Char* filename )
    return;
 
   syntax_error:
+   if (VG_(clo_xml))
+      VG_(message)(Vg_UserMsg, "</valgrindoutput>\n");
    VG_(message)(Vg_UserMsg, 
                 "FATAL: in suppressions file '%s': %s", filename, err_str );
    
index d0c4e98b53ed015370920b1ba343d67de27224b8..8cd810b52d7a881ce622088fc610291a6ccd4439 100644 (file)
@@ -37,6 +37,7 @@
 #include "pub_core_stacktrace.h"
 #include "pub_core_syscall.h"
 #include "pub_core_tooliface.h"     // For VG_(details).{name,bug_reports_to}
+#include "pub_core_options.h"       // For VG_(clo_xml)
 #include "vki_unistd.h"
 
 /* ---------------------------------------------------------------------
@@ -167,6 +168,9 @@ void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,
       bugs_to   = VG_(details).bug_reports_to;
    }
 
+   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 @@ __attribute__ ((noreturn))
 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 @@ void VG_(tool_panic) ( Char* str )
 /* 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, 
       "Valgrind detected that your program requires");