diff options
author | Pedro Alves <palves@redhat.com> | 2019-01-24 18:25:06 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-01-24 18:25:06 +0000 |
commit | adc6a863a9c6c828425d63b12d553f0e8f21e350 (patch) | |
tree | 707b67c07bca0de636702016728f8eb8dd8f49a5 /gdb/linux-nat.c | |
parent | 3046d67a0e29686ec18abd719660969c97973063 (diff) | |
download | binutils-gdb-adc6a863a9c6c828425d63b12d553f0e8f21e350.tar.gz |
target_pass_signals/target_program_signals: Use gdb::array_view
This replaces the pointer and length parameters of target_pass_signals
and target_program_signals with a gdb::array_view parameter, and fixes
the fallout.
In infrun.c, the signal_stop, signal_print, signal_program,
signal_catch, signal_pass globals are currently pointers to
heap-allocated memory. I see no point in that, so I converted them to
arrays. This allows simplifying the calls to
target_pass_signals/target_program_signals, since we can pass the
array directly, which can implicitly convert to gdb::array_view.
gdb/ChangeLog:
2019-01-24 Pedro Alves <palves@redhat.com>
* infrun.c (signal_stop, signal_print, signal_program)
(signal_catch, signal_pass): Now arrays instead of pointers.
(update_signals_program_target, do_target_resume)
(signal_catch_update, handle_command, _initialize_infrun): Adjust.
* linux-nat.c (linux_nat_target::pass_signals)
(linux_nat_target::create_inferior, linux_nat_target::attach):
Adjust.
* linux-nat.h (linux_nat_target::pass_signals): Adjust.
* nto-procfs.c (nto_procfs_target::pass_signals): Adjust.
* procfs.c (procfs_target::pass_signals): Adjust.
* record-full.c (record_full_target::resume): Adjust.
* remote.c (remote_target::pass_signals)
(remote_target::program_signals): Adjust.
* target-debug.h (target_debug_print_signals): Now takes a
gdb::array_view as parameter. Adjust.
* target.h (target_ops) <pass_signals, program_signals>: Replace
pointer and length parameters with gdb::array_view.
(target_pass_signals, target_program_signals): Likewise.
* target-delegates.c: Regenerate.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 45da9fa9973..c285e914d53 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -789,7 +789,8 @@ static sigset_t pass_mask; /* Update signals to pass to the inferior. */ void -linux_nat_target::pass_signals (int numsigs, const unsigned char *pass_signals) +linux_nat_target::pass_signals + (gdb::array_view<const unsigned char> pass_signals) { int signo; @@ -798,7 +799,7 @@ linux_nat_target::pass_signals (int numsigs, const unsigned char *pass_signals) for (signo = 1; signo < NSIG; signo++) { int target_signo = gdb_signal_from_host (signo); - if (target_signo < numsigs && pass_signals[target_signo]) + if (target_signo < pass_signals.size () && pass_signals[target_signo]) sigaddset (&pass_mask, signo); } } @@ -1096,7 +1097,7 @@ linux_nat_target::create_inferior (const char *exec_file, we have to mask the async mode. */ /* Make sure we report all signals during startup. */ - pass_signals (0, NULL); + pass_signals ({}); inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty); } @@ -1186,7 +1187,7 @@ linux_nat_target::attach (const char *args, int from_tty) ptid_t ptid; /* Make sure we report all signals during attach. */ - pass_signals (0, NULL); + pass_signals ({}); TRY { |