|
From: <sv...@va...> - 2005-06-25 15:22:16
|
Author: sewardj
Date: 2005-06-25 16:22:10 +0100 (Sat, 25 Jun 2005)
New Revision: 4018
Log:
Do not print backtraces in assertion failures. This is an as-yet
unsuccessful attempt to remove m_libcassert from the huge cycle which
most of the modules currently live in.
VG_(get_StackTrace2) can now be privatised, but I haven't done so yet.
Modified:
trunk/coregrind/m_libcassert.c
trunk/coregrind/pub_core_stacktrace.h
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-06-25 14:43:05 UTC (rev 4017)
+++ trunk/coregrind/m_libcassert.c 2005-06-25 15:22:10 UTC (rev 4018)
@@ -33,8 +33,8 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
-#include "pub_core_libcproc.h" // For VG_(gettid)()
-#include "pub_core_stacktrace.h"
+//zz hash inklood "pub_cor_libcproc.h" // For VG_(gettid)()
+//zz hash inklood "pub_cor_stacktrace.h"
#include "pub_core_syscall.h"
#include "pub_core_tooliface.h" // For VG_(details).{name,bug_report=
s_to}
#include "vki_unistd.h"
@@ -43,30 +43,30 @@
Assertery.
------------------------------------------------------------------ */
=20
-#if defined(VGP_x86_linux)
-# define GET_REAL_SP_AND_FP(sp, fp) \
- asm("movl %%esp, %0;" \
- "movl %%ebp, %1;" \
- : "=3Dr" (sp),\
- "=3Dr" (fp));
-#elif defined(VGP_amd64_linux)
-# define GET_REAL_SP_AND_FP(sp, fp) \
- asm("movq %%rsp, %0;" \
- "movq %%rbp, %1;" \
- : "=3Dr" (sp),\
- "=3Dr" (fp));
-#elif defined(VGP_ppc32_linux)
-# define GET_REAL_SP_AND_FP(sp, fp) \
- asm("mr %0,1;" \
- "mr %1,1;" \
- : "=3Dr" (sp),\
- "=3Dr" (fp));
-#else
-# error Unknown platform
-#endif
+//zz #if defined(VGP_x86_linux)
+//zz # define GET_REAL_SP_AND_FP(sp, fp) \
+//zz asm("movl %%esp, %0;" \
+//zz "movl %%ebp, %1;" \
+//zz : "=3Dr" (sp),\
+//zz "=3Dr" (fp));
+//zz #elif defined(VGP_amd64_linux)
+//zz # define GET_REAL_SP_AND_FP(sp, fp) \
+//zz asm("movq %%rsp, %0;" \
+//zz "movq %%rbp, %1;" \
+//zz : "=3Dr" (sp),\
+//zz "=3Dr" (fp));
+//zz #elif defined(VGP_ppc32_linux)
+//zz # define GET_REAL_SP_AND_FP(sp, fp) \
+//zz asm("mr %0,1;" \
+//zz "mr %1,1;" \
+//zz : "=3Dr" (sp),\
+//zz "=3Dr" (fp));
+//zz #else
+//zz # error Unknown platform
+//zz #endif
+//zz=20
+//zz #define BACKTRACE_DEPTH 100 // nice and deep!
=20
-#define BACKTRACE_DEPTH 100 // nice and deep!
-
/* Pull down the entire world */
void VG_(exit)( Int status )
{
@@ -88,7 +88,7 @@
if (VG_(threads)[i].status =3D=3D VgTs_Empty) continue;
VG_(printf)( "\nThread %d: status =3D %s\n", i,=20
VG_(name_of_ThreadStatus)(VG_(threads)[i].status) );
- VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
+//zz VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
}
VG_(printf)("\n");
}
@@ -96,25 +96,26 @@
__attribute__ ((noreturn))
static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr=
fp )
{
- Addr stacktop, ips[BACKTRACE_DEPTH];
- ThreadState *tst;
+//zz Addr stacktop;
+//zz Addr ips[BACKTRACE_DEPTH];
+//zz ThreadState *tst;
+//zz=20
+//zz tst =3D VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
+//zz=20
+//zz // If necessary, fake up an ExeContext which is of our actual re=
al CPU
+//zz // state. Could cause problems if we got the panic/exception wi=
thin the
+//zz // execontext/stack dump/symtab code. But it's better than noth=
ing.
+//zz if (0 =3D=3D ip && 0 =3D=3D sp && 0 =3D=3D fp) {
+//zz ip =3D (Addr)__builtin_return_address(0);
+//zz GET_REAL_SP_AND_FP(sp, fp);
+//zz }
+//zz=20
+//zz stacktop =3D tst->os_state.valgrind_stack_base +=20
+//zz tst->os_state.valgrind_stack_szB;
+//zz=20
+//zz VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stack=
top);
+//zz VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
=20
- tst =3D VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
-
- // If necessary, fake up an ExeContext which is of our actual real CP=
U
- // state. Could cause problems if we got the panic/exception within =
the
- // execontext/stack dump/symtab code. But it's better than nothing.
- if (0 =3D=3D ip && 0 =3D=3D sp && 0 =3D=3D fp) {
- ip =3D (Addr)__builtin_return_address(0);
- GET_REAL_SP_AND_FP(sp, fp);
- }
-
- stacktop =3D tst->os_state.valgrind_stack_base +=20
- tst->os_state.valgrind_stack_szB;
-
- VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
- VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
-
// Don't print this, as it's not terribly interesting and avoids a
// dependence on m_scheduler/, which would be crazy.
//VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_do=
ne) );
Modified: trunk/coregrind/pub_core_stacktrace.h
=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/pub_core_stacktrace.h 2005-06-25 14:43:05 UTC (rev 40=
17)
+++ trunk/coregrind/pub_core_stacktrace.h 2005-06-25 15:22:10 UTC (rev 40=
18)
@@ -38,10 +38,10 @@
=20
#include "pub_tool_stacktrace.h"
=20
-// Variant that gives a little more control over the stack-walking.
-extern UInt VG_(get_StackTrace2) ( StackTrace ips, UInt n_ips,=20
- Addr ip, Addr sp, Addr fp,=20
- Addr fp_min, Addr fp_max );
+//zz // Variant that gives a little more control over the stack-walking.
+//zz extern UInt VG_(get_StackTrace2) ( StackTrace ips, UInt n_ips,=20
+//zz Addr ip, Addr sp, Addr fp,=20
+//zz Addr fp_min, Addr fp_max );
=20
#endif // __PUB_CORE_STACKTRACE_H
=20
|