]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add debugging hack, if 0'd, to print a stack trace at each syscall.
authorJulian Seward <jseward@acm.org>
Wed, 15 Jun 2011 15:11:50 +0000 (15:11 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 15 Jun 2011 15:11:50 +0000 (15:11 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11815

coregrind/m_syswrap/syswrap-main.c

index 0757a4177582a26fdadab5143f470e424f4934a3..f50a57b158671a9fe9405eb96e8f977d6477a74e 100644 (file)
@@ -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