From db20ebdfae432f23def32f0b9bbf6e023c926235 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 2 Oct 2020 14:44:38 -0400 Subject: gdb: give names to async event/signal handlers Assign names to async event/signal handlers. They will be used in debug messages when file handlers are invoked. Unlike in the previous patch, the names are not copied in the structure, since we don't need to (all names are string literals for the moment). gdb/ChangeLog: * async-event.h (create_async_signal_handler): Add name parameter. (create_async_event_handler): Likewise. * async-event.c (struct async_signal_handler) : New field. (struct async_event_handler) : New field. (create_async_signal_handler): Assign name. (create_async_event_handler): Assign name. * event-top.c (async_init_signals): Pass name when creating handler. * infrun.c (_initialize_infrun): Likewise. * record-btrace.c (record_btrace_push_target): Likewise. * record-full.c (record_full_open): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (remote_target::open_1): Likewise. * tui/tui-win.c (tui_initialize_win): Likewise. Change-Id: Icd9d9f775542ae5fc2cd148c12f481e7885936d5 --- gdb/event-top.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gdb/event-top.c') diff --git a/gdb/event-top.c b/gdb/event-top.c index c96f104..fdce5de 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -916,10 +916,10 @@ async_init_signals (void) signal (SIGINT, handle_sigint); sigint_token = - create_async_signal_handler (async_request_quit, NULL); + create_async_signal_handler (async_request_quit, NULL, "sigint"); signal (SIGTERM, handle_sigterm); async_sigterm_token - = create_async_signal_handler (async_sigterm_handler, NULL); + = create_async_signal_handler (async_sigterm_handler, NULL, "sigterm"); /* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed to the inferior and breakpoints will be ignored. */ @@ -938,23 +938,23 @@ async_init_signals (void) to SIG_DFL for us. */ signal (SIGQUIT, handle_sigquit); sigquit_token = - create_async_signal_handler (async_do_nothing, NULL); + create_async_signal_handler (async_do_nothing, NULL, "sigquit"); #endif #ifdef SIGHUP if (signal (SIGHUP, handle_sighup) != SIG_IGN) sighup_token = - create_async_signal_handler (async_disconnect, NULL); + create_async_signal_handler (async_disconnect, NULL, "sighup"); else sighup_token = - create_async_signal_handler (async_do_nothing, NULL); + create_async_signal_handler (async_do_nothing, NULL, "sighup"); #endif signal (SIGFPE, handle_sigfpe); sigfpe_token = - create_async_signal_handler (async_float_handler, NULL); + create_async_signal_handler (async_float_handler, NULL, "sigfpe"); #ifdef SIGTSTP sigtstp_token = - create_async_signal_handler (async_sigtstp_handler, NULL); + create_async_signal_handler (async_sigtstp_handler, NULL, "sigtstp"); #endif install_handle_sigsegv (); -- cgit v1.1