diff options
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r-- | gdb/event-top.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c index c533e74..f96982a 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 @@ -1649,9 +1650,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, |