diff options
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r-- | gdb/event-top.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c index c533e74..3138e8c 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -980,11 +980,6 @@ handle_fatal_signal (int sig) #endif #ifdef GDB_PRINT_INTERNAL_BACKTRACE - const auto sig_write = [] (const char *msg) -> void - { - gdb_stderr->write_async_safe (msg, strlen (msg)); - }; - if (bt_on_fatal_signal) { sig_write ("\n\n"); @@ -1027,7 +1022,13 @@ handle_fatal_signal (int sig) } sig_write ("\n\n"); - gdb_stderr->flush (); + if (gdb_stderr == nullptr || gdb_stderr->fd () == -1) + { + /* Writing to file descriptor instead of stream, no flush + required. */ + } + else + gdb_stderr->flush (); } #endif @@ -1179,6 +1180,9 @@ quit (void) throw_forced_quit ("SIGTERM"); } + /* Pressing ^C cancels i-search. Tell readline that a ^C happened. */ + rl_callback_sigcleanup (); + #ifdef __MSDOS__ /* No steenking SIGINT will ever be coming our way when the program is resumed. Don't lie. */ @@ -1649,9 +1653,7 @@ show_debug_event_loop_command (struct ui_file *file, int from_tty, gdb_printf (file, _("Event loop debugging is %s.\n"), value); } -void _initialize_event_top (); -void -_initialize_event_top () +INIT_GDB_FILE (event_top) { add_setshow_enum_cmd ("event-loop", class_maintenance, debug_event_loop_enum, |