]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Patch from Tom Hughes: make --gdb-attach=yes work when a program is
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Mon, 8 Dec 2003 21:58:37 +0000 (21:58 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Mon, 8 Dec 2003 21:58:37 +0000 (21:58 +0000)
killed by a fatal signal.

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

coregrind/vg_signals.c

index 1984c23dea9eb0354ad8f4c386318070ad25e712..ece604ab86713c1109c1c9515c45467e27e1ad6d 100644 (file)
@@ -1386,7 +1386,12 @@ static void vg_default_action(const vki_ksiginfo_t *info, ThreadId tid)
            VG_(pp_ExeContext)(ec);
         }
       }
-      
+
+      if (VG_(is_action_requested)( "Attach to GDB", & VG_(clo_GDB_attach) )) {
+         ThreadState* tst = & VG_(threads)[ tid ];      
+        VG_(swizzle_esp_then_start_GDB)( tst->m_eip, tst->m_esp, tst->m_ebp );
+      }
+
       if (VG_(fatal_signal_set)) {
         VG_(fatal_sigNo) = sigNo;
         __builtin_longjmp(VG_(fatal_signal_jmpbuf), 1);