where XXXXXX is the bug number as listed below.
339020 ppc64: memcheck/tests/ppc64/power_ISA2_05 failing in nightly build
+339156 - gdbsrv not called for fatal signal
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
return ret;
}
+
+void VG_(gdbserver_report_fatal_signal) (Int vki_sigNo, ThreadId tid)
+{
+ dlog(1, "VG core calling VG_(gdbserver_report_fatal_signal) "
+ "vki_nr %d %s gdb_nr %d %s tid %d\n",
+ vki_sigNo, VG_(signame)(vki_sigNo),
+ target_signal_from_host (vki_sigNo),
+ target_signal_to_name(target_signal_from_host (vki_sigNo)),
+ tid);
+
+ if (remote_connected()) {
+ dlog(1, "already connected, assuming already reported\n");
+ return;
+ }
+
+ VG_(umsg)("(action on fatal signal) vgdb me ... \n");
+
+ /* indicate to gdbserver that there is a signal */
+ gdbserver_signal_encountered (vki_sigNo);
+
+ /* let gdbserver do some work, e.g. show the signal to the user */
+ call_gdbserver (tid, signal_reason);
+
+}
+
Bool VG_(gdbserver_report_signal) (Int vki_sigNo, ThreadId tid)
{
dlog(1, "VG core calling VG_(gdbserver_report_signal) "
}
}
+ if (VG_(clo_vgdb) != Vg_VgdbNo
+ && VG_(dyn_vgdb_error) <= VG_(get_n_errs_shown)() + 1) {
+ /* Note: we add + 1 to n_errs_shown as the fatal signal was not
+ reported through error msg, and so was not counted. */
+ VG_(gdbserver_report_fatal_signal) (sigNo, tid);
+ }
+
if (VG_(is_action_requested)( "Attach to debugger", & VG_(clo_db_attach) )) {
VG_(start_debugger)( tid );
}
extern void VG_(invoke_gdbserver) ( int check );
// To be called by core (m_signals.c) before delivering a signal.
-// Returns True unless gdb user asks to not pass the signal to the client.
+// Returns False if gdb user asks to not pass the signal to the client.
+// Returns True if signal must be passed to the client, either because
+// no gdb is connected, or gdb instructs to pass the signal.
// Note that if the below returns True, the signal might
// still be ignored if this is the action desired by the
// guest program.
-extern Bool VG_(gdbserver_report_signal) (Int signo, ThreadId tid);
+extern Bool VG_(gdbserver_report_signal) (Int vki_signo, ThreadId tid);
+
+// If no gdb is connected yet, wait for a gdb to connect and report
+// this (supposedly) fatal signal.
+// If a gdb is already connected, this does nothing (as normally
+// the signal was already reported to the already connected gdb).
+extern void VG_(gdbserver_report_fatal_signal) (Int vki_signo, ThreadId tid);
/* Entry point invoked by scheduler.c to execute the request
VALGRIND_CLIENT_MONITOR_COMMAND.