aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 1fe3784..f96982a 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -1,6 +1,6 @@
/* Top level stuff for GDB, the GNU debugger.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
@@ -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,