]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Do not print backtraces in assertion failures. This is an as-yet
authorJulian Seward <jseward@acm.org>
Sat, 25 Jun 2005 15:22:10 +0000 (15:22 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 25 Jun 2005 15:22:10 +0000 (15:22 +0000)
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.

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

coregrind/m_libcassert.c
coregrind/pub_core_stacktrace.h

index 20d359ae9476c403fea8d0025a81c7d5549a0cf0..09cef0604f773a49d04de2f52127af7e72e15457 100644 (file)
@@ -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_reports_to}
 #include "vki_unistd.h"
    Assertery.
    ------------------------------------------------------------------ */
 
-#if defined(VGP_x86_linux)
-#  define GET_REAL_SP_AND_FP(sp, fp) \
-      asm("movl %%esp, %0;" \
-          "movl %%ebp, %1;" \
-          : "=r" (sp),\
-            "=r" (fp));
-#elif defined(VGP_amd64_linux)
-#  define GET_REAL_SP_AND_FP(sp, fp) \
-      asm("movq %%rsp, %0;" \
-          "movq %%rbp, %1;" \
-          : "=r" (sp),\
-            "=r" (fp));
-#elif defined(VGP_ppc32_linux)
-#  define GET_REAL_SP_AND_FP(sp, fp) \
-      asm("mr %0,1;" \
-          "mr %1,1;" \
-          : "=r" (sp),\
-            "=r" (fp));
-#else
-#  error Unknown platform
-#endif
-
-#define BACKTRACE_DEPTH    100         // nice and deep!
+//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           : "=r" (sp),\
+//zz             "=r" (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           : "=r" (sp),\
+//zz             "=r" (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           : "=r" (sp),\
+//zz             "=r" (fp));
+//zz #else
+//zz #  error Unknown platform
+//zz #endif
+//zz 
+//zz #define BACKTRACE_DEPTH    100         // nice and deep!
 
 /* Pull down the entire world */
 void VG_(exit)( Int status )
@@ -88,7 +88,7 @@ static void pp_sched_status ( void )
       if (VG_(threads)[i].status == VgTs_Empty) continue;
       VG_(printf)( "\nThread %d: status = %s\n", i, 
                    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,24 +96,25 @@ static void pp_sched_status ( void )
 __attribute__ ((noreturn))
 static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr fp )
 {
-   Addr stacktop, ips[BACKTRACE_DEPTH];
-   ThreadState *tst;
-
-   tst = VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
-
-   // If necessary, fake up an ExeContext which is of our actual real CPU
-   // 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 == ip && 0 == sp && 0 == fp) {
-       ip = (Addr)__builtin_return_address(0);
-       GET_REAL_SP_AND_FP(sp, fp);
-   }
-
-   stacktop = tst->os_state.valgrind_stack_base + 
-              tst->os_state.valgrind_stack_szB;
-
-   VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
-   VG_(pp_StackTrace)  (ips, BACKTRACE_DEPTH);
+//zz    Addr stacktop;
+//zz    Addr ips[BACKTRACE_DEPTH];
+//zz    ThreadState *tst;
+//zz 
+//zz    tst = VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
+//zz 
+//zz    // If necessary, fake up an ExeContext which is of our actual real CPU
+//zz    // state.  Could cause problems if we got the panic/exception within the
+//zz    // execontext/stack dump/symtab code.  But it's better than nothing.
+//zz    if (0 == ip && 0 == sp && 0 == fp) {
+//zz        ip = (Addr)__builtin_return_address(0);
+//zz        GET_REAL_SP_AND_FP(sp, fp);
+//zz    }
+//zz 
+//zz    stacktop = tst->os_state.valgrind_stack_base + 
+//zz               tst->os_state.valgrind_stack_szB;
+//zz 
+//zz    VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
+//zz    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.
index 2f306a4476d9fd8ac64014498e78ee3735e003d2..fb06821fce7ce57bfc80da324c563ef88fe1380e 100644 (file)
 
 #include "pub_tool_stacktrace.h"
 
-// Variant that gives a little more control over the stack-walking.
-extern UInt VG_(get_StackTrace2) ( StackTrace ips, UInt n_ips, 
-                                   Addr ip, Addr sp, Addr fp, 
-                                   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, 
+//zz                                    Addr ip, Addr sp, Addr fp, 
+//zz                                    Addr fp_min, Addr fp_max );
 
 #endif   // __PUB_CORE_STACKTRACE_H