From: Philippe Waroquiers Date: Fri, 1 Mar 2013 20:37:41 +0000 (+0000) Subject: allow compile time tracing to be enabled using the stats counters X-Git-Tag: svn/VALGRIND_3_9_0~381 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5039f7dbbe7152fc3cbc5e03e11799f6d4b0dff3;p=thirdparty%2Fvalgrind.git allow compile time tracing to be enabled using the stats counters (so put first the static stats counters). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13300 --- diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c index 0420200a1c..3a1fdff02b 100644 --- a/coregrind/m_stacktrace.c +++ b/coregrind/m_stacktrace.c @@ -142,20 +142,6 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, UnwindStartRegs* startRegs, Addr fp_max_orig ) { - const Bool debug = False; // VG_(debugLog_getLevel) () > 3; // True; - const HChar* unwind_case; // used when debug is True. - // Debugging this function is not straightforward. - // Here is the easiest way I have found: - // 1. Change the above to True. - // 2. Start your program under Valgrind with --tool=none --vgdb-error=0 - // 3. Use GDB/vgdb to put a breakpoint where you want to debug the stacktrace - // 4. Continue till breakpoint is encountered - // 5. From GDB, use 'monitor v.info scheduler' and examine the unwind traces. - // You might have to do twice 'monitor v.info scheduler' to see - // the effect of caching the results of the verification. - // You can also modify the debug dynamically using by using - // 'monitor v.set debuglog 4. - const Bool do_stats = False; // compute and output some stats regularly. static struct { UInt nr; // nr of stacktraces computed @@ -171,6 +157,23 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, UInt MS; // microsoft unwind } stats; + const Bool debug = False; + // = VG_(debugLog_getLevel) () > 3; + // = True; + // = stats.nr >= 123456; + const HChar* unwind_case; // used when debug is True. + // Debugging this function is not straightforward. + // Here is the easiest way I have found: + // 1. Change the above to True. + // 2. Start your program under Valgrind with --tool=none --vgdb-error=0 + // 3. Use GDB/vgdb to put a breakpoint where you want to debug the stacktrace + // 4. Continue till breakpoint is encountered + // 5. From GDB, use 'monitor v.info scheduler' and examine the unwind traces. + // You might have to do twice 'monitor v.info scheduler' to see + // the effect of caching the results of the verification. + // You can also modify the debug dynamically using by using + // 'monitor v.set debuglog 4. + Int i; Addr fp_max; UInt n_found = 0;