diff --git a/gdb/event-top.c b/gdb/event-top.c index 210440ad80b..9233a3650ac 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -1025,7 +1025,10 @@ static struct serial_event *quit_serial_event; with the reception of the signal. For SIGSEGV the handle_sig* function does all the work for handling this - signal. */ + signal. + + For SIGFPE, SIGBUS, and SIGABRT, these signals will all cause GDB to + terminate immediately. */ void gdb_init_signals (void) { @@ -1061,6 +1064,18 @@ gdb_init_signals (void) create_async_signal_handler (async_sigtstp_handler, NULL, "sigtstp"); #endif +#ifdef SIGFPE + signal (SIGFPE, handle_fatal_signal); +#endif + +#ifdef SIGBUS + signal (SIGBUS, handle_fatal_signal); +#endif + +#ifdef SIGABRT + signal (SIGABRT, handle_fatal_signal); +#endif + install_handle_sigsegv (); } diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp index 7a9f8e45fde..8875d00fdb1 100644 --- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp +++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp @@ -54,7 +54,10 @@ gdb_test_multiple "maint set backtrace-on-fatal-signal on" "" { } # Now the actual test loop. -foreach test_data {{SEGV "Segmentation fault"}} { +foreach test_data {{SEGV "Segmentation fault"} \ + {FPE "Floating point exception"} \ + {BUS "Bus error"} \ + {ABRT "Aborted"}} { set sig [lindex ${test_data} 0] set msg [lindex ${test_data} 1] with_test_prefix ${sig} {