diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2011-04-27 13:29:15 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2011-04-27 13:29:15 +0000 |
commit | 2455069d930b37918b92281be109444d1e38dc6d (patch) | |
tree | 1dede0ae37934adb93839c5dbe7d705198704b2b /gdb/procfs.c | |
parent | 46c6471b0a591c6a53cf9bacdee6663cc63cd588 (diff) | |
download | gdb-2455069d930b37918b92281be109444d1e38dc6d.zip gdb-2455069d930b37918b92281be109444d1e38dc6d.tar.gz gdb-2455069d930b37918b92281be109444d1e38dc6d.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index 5d7cb23..2a21526 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -120,7 +120,7 @@ static void procfs_fetch_registers (struct target_ops *, struct regcache *, int); static void procfs_store_registers (struct target_ops *, struct regcache *, int); -static void procfs_notice_signals (ptid_t); +static void procfs_pass_signals (ptid_t, int, unsigned char *); static void procfs_kill_inferior (struct target_ops *ops); static void procfs_mourn_inferior (struct target_ops *ops); static void procfs_create_inferior (struct target_ops *, char *, @@ -201,7 +201,7 @@ procfs_target (void) t->to_store_registers = procfs_store_registers; t->to_xfer_partial = procfs_xfer_partial; t->deprecated_xfer_memory = procfs_xfer_memory; - t->to_notice_signals = procfs_notice_signals; + t->to_pass_signals = procfs_pass_signals; t->to_files_info = procfs_files_info; t->to_stop = procfs_stop; @@ -3147,7 +3147,6 @@ proc_iterate_over_threads (procinfo *pi, static ptid_t do_attach (ptid_t ptid); static void do_detach (int signo); -static int register_gdb_signals (procinfo *, gdb_sigset_t *); static void proc_trace_syscalls_1 (procinfo *pi, int syscallnum, int entry_or_exit, int mode, int from_tty); @@ -3186,9 +3185,9 @@ procfs_debug_inferior (procinfo *pi) if (!proc_set_traced_faults (pi, &traced_faults)) return __LINE__; - /* Register to trace selected signals in the child. */ - premptyset (&traced_signals); - if (!register_gdb_signals (pi, &traced_signals)) + /* Initially, register to trace all signals in the child. */ + prfillset (&traced_signals); + if (!proc_set_traced_signals (pi, &traced_signals)) return __LINE__; @@ -4464,40 +4463,26 @@ procfs_resume (struct target_ops *ops, } } -/* Traverse the list of signals that GDB knows about (see "handle" - command), and arrange for the target to be stopped or not, - according to these settings. Returns non-zero for success, zero - for failure. */ - -static int -register_gdb_signals (procinfo *pi, gdb_sigset_t *signals) -{ - int signo; - - for (signo = 0; signo < NSIG; signo ++) - if (signal_stop_state (target_signal_from_host (signo)) == 0 && - signal_print_state (target_signal_from_host (signo)) == 0 && - signal_pass_state (target_signal_from_host (signo)) == 1) - gdb_prdelset (signals, signo); - else - gdb_praddset (signals, signo); - - return proc_set_traced_signals (pi, signals); -} - /* Set up to trace signals in the child process. */ static void -procfs_notice_signals (ptid_t ptid) +procfs_pass_signals (int numsigs, unsigned char *pass_signals) { gdb_sigset_t signals; - procinfo *pi = find_procinfo_or_die (PIDGET (ptid), 0); + procinfo *pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0); + int signo; - if (proc_get_traced_signals (pi, &signals) && - register_gdb_signals (pi, &signals)) - return; - else - proc_error (pi, "notice_signals", __LINE__); + prfillset (&signals); + + for (signo = 0; signo < NSIG; signo++) + { + int target_signo = target_signal_from_host (signo); + if (target_signo < numsigs && pass_signals[target_signo]) + gdb_prdelset (&signals, signo); + } + + if (!proc_set_traced_signals (pi, &signals)) + proc_error (pi, "pass_signals", __LINE__); } /* Print status information about the child process. */ @@ -4679,11 +4664,6 @@ procfs_init_inferior (struct target_ops *ops, int pid) if (!proc_get_traced_sysexit (pi, pi->saved_exitset)) proc_error (pi, "init_inferior, get_traced_sysexit", __LINE__); - /* Register to trace selected signals in the child. */ - prfillset (&signals); - if (!register_gdb_signals (pi, &signals)) - proc_error (pi, "init_inferior, register_signals", __LINE__); - if ((fail = procfs_debug_inferior (pi)) != 0) proc_error (pi, "init_inferior (procfs_debug_inferior)", fail); |