From: Julian Seward Date: Wed, 15 Jun 2011 15:11:50 +0000 (+0000) Subject: Add debugging hack, if 0'd, to print a stack trace at each syscall. X-Git-Tag: svn/VALGRIND_3_7_0~422 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01abe3ed83e310366791880c29157cb733677e7a;p=thirdparty%2Fvalgrind.git Add debugging hack, if 0'd, to print a stack trace at each syscall. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11815 --- diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index 0757a41775..f50a57b158 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -1429,6 +1429,13 @@ void VG_(client_syscall) ( ThreadId tid, UInt trc ) is interrupted by a signal. */ sysno = sci->orig_args.sysno; + /* It's sometimes useful, as a crude debugging hack, to get a + stack trace at each (or selected) syscalls. */ + if (0 /* sysno == __NR_mmap */) { + VG_(umsg)("\n"); + VG_(get_and_pp_StackTrace)(tid, 10); + } + # if defined(VGO_darwin) /* Record syscall class. But why? Because the syscall might be interrupted by a signal, and in the signal handler (which will