* target.h (struct target_ops): Remove to_notice_signals;
add to_pass_signals. (target_notice_signals): Remove. (target_pass_signals): Add prototype. * target.c (update_current_target): Remove to_notice_signals; mention to_pass_signals. (target_pass_signals): New function. (debug_to_notice_signals): Remove. (setup_target_debug): Do not install debug_to_notice_signals. * infrun.c (signal_pass): New global. (resume): Call target_pass_signals. (handle_inferior_event): Report all signals while stepping over non-steppable watchpoint. Reset trap_expected to ensure breakpoints are re-inserted when stepping over a signal handler. (signal_cache_update): New function. (signal_stop_update): Call it. (signal_print_update): Likewise. (signal_pass_update): Likewise. (handle_command): Call signal_cache_update and target_pass_signals instead of target_notice_signals. (_initialize_infrun): Initialize signal_pass. * linux-nat.c (pass_mask): New global. (linux_nat_pass_signals): New function. (linux_nat_create_inferior): Report all signals initially. (linux_nat_attach): Likewise. (linux_nat_resume): Use pass_mask to decide whether to directly handle an inferior signal. (linux_nat_wait_1): Likewise. (linux_nat_add_target): Install to_pass_signals callback. * nto-procfs.c (notice_signals): Remove. (procfs_resume): Do not call notice_signals. (procfs_notice_signals): Remove. (procfs_pass_signals): New function. (init_procfs_ops): Install to_pass_signals callback instead of to_notice_signals callback. (_initialize_procfs): Report all signals initially. * procfs.c (procfs_notice_signals): Remove. (procfs_pass_signals): New function. (procfs_target): Install to_pass_signals callback instead of to_notice_signals callback. (register_gdb_signals): Remove. (procfs_debug_inferior): Report all signals initially. (procfs_init_inferior): Remove redundant register_gdb_signals call. * remote.c (remote_pass_signals): Add numsigs and pass_signals parameters; use them instead of calling signal_..._state routines. (remote_notice_signals): Remove. (remote_start_remote): Report all signals initially. (remote_resume): Do not call remote_pass_signals. (_initialize_remote): Install to_pass_signals callback instead of to_notice_signals callback.
This commit is contained in:
parent
46c6471b0a
commit
2455069d93
8 changed files with 230 additions and 137 deletions
48
gdb/target.c
48
gdb/target.c
|
@ -149,8 +149,6 @@ static void debug_to_load (char *, int);
|
|||
|
||||
static int debug_to_can_run (void);
|
||||
|
||||
static void debug_to_notice_signals (ptid_t);
|
||||
|
||||
static void debug_to_stop (ptid_t);
|
||||
|
||||
/* Pointer to array of target architecture structures; the size of the
|
||||
|
@ -625,7 +623,7 @@ update_current_target (void)
|
|||
INHERIT (to_has_exited, t);
|
||||
/* Do not inherit to_mourn_inferior. */
|
||||
INHERIT (to_can_run, t);
|
||||
INHERIT (to_notice_signals, t);
|
||||
/* Do not inherit to_pass_signals. */
|
||||
/* Do not inherit to_thread_alive. */
|
||||
/* Do not inherit to_find_new_threads. */
|
||||
/* Do not inherit to_pid_to_str. */
|
||||
|
@ -793,9 +791,6 @@ update_current_target (void)
|
|||
return_zero);
|
||||
de_fault (to_can_run,
|
||||
return_zero);
|
||||
de_fault (to_notice_signals,
|
||||
(void (*) (ptid_t))
|
||||
target_ignore);
|
||||
de_fault (to_extra_thread_info,
|
||||
(char *(*) (struct thread_info *))
|
||||
return_zero);
|
||||
|
@ -2587,6 +2582,37 @@ target_resume (ptid_t ptid, int step, enum target_signal signal)
|
|||
|
||||
noprocess ();
|
||||
}
|
||||
|
||||
void
|
||||
target_pass_signals (int numsigs, unsigned char *pass_signals)
|
||||
{
|
||||
struct target_ops *t;
|
||||
|
||||
for (t = current_target.beneath; t != NULL; t = t->beneath)
|
||||
{
|
||||
if (t->to_pass_signals != NULL)
|
||||
{
|
||||
if (targetdebug)
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf_unfiltered (gdb_stdlog, "target_pass_signals (%d, {",
|
||||
numsigs);
|
||||
|
||||
for (i = 0; i < numsigs; i++)
|
||||
if (pass_signals[i])
|
||||
fprintf_unfiltered (gdb_stdlog, " %s",
|
||||
target_signal_to_name (i));
|
||||
|
||||
fprintf_unfiltered (gdb_stdlog, " })\n");
|
||||
}
|
||||
|
||||
(*t->to_pass_signals) (numsigs, pass_signals);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Look through the list of possible targets for a target that can
|
||||
follow forks. */
|
||||
|
||||
|
@ -3914,15 +3940,6 @@ debug_to_can_run (void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
debug_to_notice_signals (ptid_t ptid)
|
||||
{
|
||||
debug_target.to_notice_signals (ptid);
|
||||
|
||||
fprintf_unfiltered (gdb_stdlog, "target_notice_signals (%d)\n",
|
||||
PIDGET (ptid));
|
||||
}
|
||||
|
||||
static struct gdbarch *
|
||||
debug_to_thread_architecture (struct target_ops *ops, ptid_t ptid)
|
||||
{
|
||||
|
@ -4010,7 +4027,6 @@ setup_target_debug (void)
|
|||
current_target.to_remove_exec_catchpoint = debug_to_remove_exec_catchpoint;
|
||||
current_target.to_has_exited = debug_to_has_exited;
|
||||
current_target.to_can_run = debug_to_can_run;
|
||||
current_target.to_notice_signals = debug_to_notice_signals;
|
||||
current_target.to_stop = debug_to_stop;
|
||||
current_target.to_rcmd = debug_to_rcmd;
|
||||
current_target.to_pid_to_exec_file = debug_to_pid_to_exec_file;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue