From: Julian Seward Date: Mon, 14 Nov 2005 17:01:01 +0000 (+0000) Subject: In XML mode, emit a closing on various kinds of X-Git-Tag: svn/VALGRIND_3_1_0~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e274987965ccfd85f91edfad82332404f0e8b28;p=thirdparty%2Fvalgrind.git In XML mode, emit a closing 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 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5130 --- diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c index c06a5091d7..a5fd02d959 100644 --- a/coregrind/m_errormgr.c +++ b/coregrind/m_errormgr.c @@ -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, "\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, "\n"); VG_(message)(Vg_UserMsg, "FATAL: in suppressions file '%s': %s", filename, err_str ); diff --git a/coregrind/m_libcassert.c b/coregrind/m_libcassert.c index d0c4e98b53..8cd810b52d 100644 --- a/coregrind/m_libcassert.c +++ b/coregrind/m_libcassert.c @@ -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, "\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, "\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, "\n"); VG_(message)(Vg_UserMsg, ""); VG_(message)(Vg_UserMsg, "Valgrind detected that your program requires");