Patch from Tom Hughes: make --gdb-attach=yes work when a program is
killed by a fatal signal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2100 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_signals.c b/coregrind/vg_signals.c
index 1984c23..ece604a 100644
--- a/coregrind/vg_signals.c
+++ b/coregrind/vg_signals.c
@@ -1386,7 +1386,12 @@
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);