|
From: <sv...@va...> - 2009-05-17 14:08:04
|
Author: sewardj
Date: 2009-05-17 15:07:57 +0100 (Sun, 17 May 2009)
New Revision: 9859
Log:
* Make assertion failures interact with XML output better:
- ensure the stack trace goes on the text output channel
- restore printing of "</valgrindoutput>" in case of
abnormal termination
* Merge a small part of r9832 from the trunk, the part to
fix generation of bogus stack traces
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c
Modified: branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c 2009-05-17 14:02:56 UTC (rev 9858)
+++ branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c 2009-05-17 14:07:57 UTC (rev 9859)
@@ -130,6 +130,7 @@
{
Addr stacktop;
Addr ips[BACKTRACE_DEPTH];
+ Int n_ips;
ThreadState *tst
= VG_(get_ThreadState)( VG_(lwpid_to_vgtid)( VG_(gettid)() ) );
@@ -141,16 +142,18 @@
}
stacktop = tst->os_state.valgrind_stack_init_SP;
+
+ n_ips =
+ VG_(get_StackTrace_wrk)(
+ 0/*tid is unknown*/,
+ ips, BACKTRACE_DEPTH,
+ NULL/*array to dump SP values in*/,
+ NULL/*array to dump FP values in*/,
+ ip, sp, fp, lr, sp, stacktop
+ );
+ VG_(clo_xml) = False;
+ VG_(pp_StackTrace) (ips, n_ips);
- VG_(get_StackTrace_wrk)(
- 0/*tid is unknown*/,
- ips, BACKTRACE_DEPTH,
- NULL/*array to dump SP values in*/,
- NULL/*array to dump FP values in*/,
- ip, sp, fp, lr, sp, stacktop
- );
- VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
-
VG_(show_sched_status)();
VG_(printf)(
"\n"
@@ -194,7 +197,7 @@
}
if (VG_(clo_xml))
- VG_(UMSG)("</valgrindoutput>\n");
+ VG_(printf_xml)("</valgrindoutput>\n");
// Treat vg_assert2(0, "foo") specially, as a panicky abort
if (VG_STREQ(expr, "0")) {
@@ -215,7 +218,7 @@
Addr ip, Addr sp, Addr fp, Addr lr )
{
if (VG_(clo_xml))
- VG_(UMSG)("</valgrindoutput>\n");
+ VG_(printf_xml)("</valgrindoutput>\n");
VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str);
report_and_quit(report, ip, sp, fp, lr);
}
@@ -239,7 +242,7 @@
void VG_(unimplemented) ( Char* msg )
{
if (VG_(clo_xml))
- VG_(UMSG)("</valgrindoutput>\n");
+ VG_(printf_xml)("</valgrindoutput>\n");
VG_(UMSG)("\n");
VG_(UMSG)("Valgrind detected that your program requires\n");
VG_(UMSG)("the following unimplemented functionality:\n");
|