mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
gdb: rename async_init_signals to gdb_init_signals
The async_init_signals has, for some time, dealt with async and sync signals, so removing the async prefix makes sense I think. Additionally, as pointed out by Pedro: ..... The comments relating to SIGTRAP and SIGQUIT within this function are out of date. The comments for SIGTRAP talk about the signal disposition (SIG_IGN) being passed to the inferior, meaning the signal disposition being inherited by GDB's fork children. However, we now call restore_original_signals_state prior to forking, so the comment on SIGTRAP is redundant. The comments for SIGQUIT are similarly out of date, further, the comment on SIGQUIT talks about problems with BSD4.3 and vfork, however, we have not supported BSD4.3 for several years now. Given the above, it seems that changing the disposition of SIGTRAP is no longer needed, so I've deleted the signal() call for SIGTRAP. Finally, the header comment on the function now called gdb_init_signals was getting quite out of date, so I've updated it to (hopefully) better reflect reality. There should be no user visible change after this commit.
This commit is contained in:
@ -899,20 +899,21 @@ handle_sigsegv (int sig)
|
|||||||
handler. */
|
handler. */
|
||||||
static struct serial_event *quit_serial_event;
|
static struct serial_event *quit_serial_event;
|
||||||
|
|
||||||
/* Initialization of signal handlers and tokens. There is a function
|
/* Initialization of signal handlers and tokens. There are a number of
|
||||||
handle_sig* for each of the signals GDB cares about. Specifically:
|
different strategies for handling different signals here.
|
||||||
SIGINT, SIGQUIT, SIGTSTP, SIGHUP, SIGWINCH. These
|
|
||||||
functions are the actual signal handlers associated to the signals
|
For SIGINT, SIGTERM, SIGQUIT, SIGHUP, SIGTSTP, there is a function
|
||||||
via calls to signal(). The only job for these functions is to
|
handle_sig* for each of these signals. These functions are the actual
|
||||||
enqueue the appropriate event/procedure with the event loop. Such
|
signal handlers associated to the signals via calls to signal(). The
|
||||||
procedures are the old signal handlers. The event loop will take
|
only job for these functions is to enqueue the appropriate
|
||||||
care of invoking the queued procedures to perform the usual tasks
|
event/procedure with the event loop. The event loop will take care of
|
||||||
associated with the reception of the signal. */
|
invoking the queued procedures to perform the usual tasks associated
|
||||||
/* NOTE: 1999-04-30 This is the asynchronous version of init_signals.
|
with the reception of the signal.
|
||||||
init_signals will become obsolete as we move to have to event loop
|
|
||||||
as the default for gdb. */
|
For SIGSEGV the handle_sig* function does all the work for handling this
|
||||||
|
signal. */
|
||||||
void
|
void
|
||||||
async_init_signals (void)
|
gdb_init_signals (void)
|
||||||
{
|
{
|
||||||
initialize_async_signal_handlers ();
|
initialize_async_signal_handlers ();
|
||||||
|
|
||||||
@ -926,21 +927,7 @@ async_init_signals (void)
|
|||||||
= create_async_signal_handler (async_sigterm_handler, NULL, "sigterm");
|
= create_async_signal_handler (async_sigterm_handler, NULL, "sigterm");
|
||||||
signal (SIGTERM, handle_sigterm);
|
signal (SIGTERM, handle_sigterm);
|
||||||
|
|
||||||
/* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed
|
|
||||||
to the inferior and breakpoints will be ignored. */
|
|
||||||
#ifdef SIGTRAP
|
|
||||||
signal (SIGTRAP, SIG_DFL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SIGQUIT
|
#ifdef SIGQUIT
|
||||||
/* If we initialize SIGQUIT to SIG_IGN, then the SIG_IGN will get
|
|
||||||
passed to the inferior, which we don't want. It would be
|
|
||||||
possible to do a "signal (SIGQUIT, SIG_DFL)" after we fork, but
|
|
||||||
on BSD4.3 systems using vfork, that can affect the
|
|
||||||
GDB process as well as the inferior (the signal handling tables
|
|
||||||
might be in memory, shared between the two). Since we establish
|
|
||||||
a handler for SIGQUIT, when we call exec it will set the signal
|
|
||||||
to SIG_DFL for us. */
|
|
||||||
sigquit_token =
|
sigquit_token =
|
||||||
create_async_signal_handler (async_do_nothing, NULL, "sigquit");
|
create_async_signal_handler (async_do_nothing, NULL, "sigquit");
|
||||||
signal (SIGQUIT, handle_sigquit);
|
signal (SIGQUIT, handle_sigquit);
|
||||||
|
@ -32,7 +32,7 @@ struct cmd_list_element;
|
|||||||
extern void display_gdb_prompt (const char *new_prompt);
|
extern void display_gdb_prompt (const char *new_prompt);
|
||||||
extern void gdb_setup_readline (int);
|
extern void gdb_setup_readline (int);
|
||||||
extern void gdb_disable_readline (void);
|
extern void gdb_disable_readline (void);
|
||||||
extern void async_init_signals (void);
|
extern void gdb_init_signals (void);
|
||||||
extern void change_line_handler (int);
|
extern void change_line_handler (int);
|
||||||
|
|
||||||
extern void command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl);
|
extern void command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl);
|
||||||
|
@ -2403,7 +2403,7 @@ gdb_init ()
|
|||||||
to alter it. */
|
to alter it. */
|
||||||
set_initial_gdb_ttystate ();
|
set_initial_gdb_ttystate ();
|
||||||
|
|
||||||
async_init_signals ();
|
gdb_init_signals ();
|
||||||
|
|
||||||
/* We need a default language for parsing expressions, so simple
|
/* We need a default language for parsing expressions, so simple
|
||||||
things like "set width 0" won't fail if no language is explicitly
|
things like "set width 0" won't fail if no language is explicitly
|
||||||
|
Reference in New Issue
Block a user