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/target.h | |
parent | 3046d67a0e29686ec18abd719660969c97973063 (diff) | |
download | gdb-adc6a863a9c6c828425d63b12d553f0e8f21e350.zip gdb-adc6a863a9c6c828425d63b12d553f0e8f21e350.tar.gz gdb-adc6a863a9c6c828425d63b12d553f0e8f21e350.tar.bz2 |
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/target.h')
-rw-r--r-- | gdb/target.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/target.h b/gdb/target.h index 14ec07f..d9b947a 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -637,14 +637,12 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ - virtual void pass_signals (int, - const unsigned char * TARGET_DEBUG_PRINTER (target_debug_print_signals)) + virtual void pass_signals (gdb::array_view<const unsigned char> TARGET_DEBUG_PRINTER (target_debug_print_signals)) TARGET_DEFAULT_IGNORE (); /* Documentation of this routine is provided with the corresponding target_* function. */ - virtual void program_signals (int, - const unsigned char * TARGET_DEBUG_PRINTER (target_debug_print_signals)) + virtual void program_signals (gdb::array_view<const unsigned char> TARGET_DEBUG_PRINTER (target_debug_print_signals)) TARGET_DEFAULT_IGNORE (); virtual bool thread_alive (ptid_t ptid) @@ -1682,7 +1680,7 @@ extern int target_can_run (); /* Set list of signals to be handled in the target. - PASS_SIGNALS is an array of size NSIG, indexed by target signal number + PASS_SIGNALS is an array indexed by target signal number (enum gdb_signal). For every signal whose entry in this array is non-zero, the target is allowed -but not required- to skip reporting arrival of the signal to the GDB core by returning from target_wait, @@ -1692,12 +1690,13 @@ extern int target_can_run (); about to receive a signal, it needs to be reported in any case, even if mentioned in a previous target_pass_signals call. */ -extern void target_pass_signals (int nsig, const unsigned char *pass_signals); +extern void target_pass_signals + (gdb::array_view<const unsigned char> pass_signals); /* Set list of signals the target may pass to the inferior. This directly maps to the "handle SIGNAL pass/nopass" setting. - PROGRAM_SIGNALS is an array of size NSIG, indexed by target signal + PROGRAM_SIGNALS is an array indexed by target signal number (enum gdb_signal). For every signal whose entry in this array is non-zero, the target is allowed to pass the signal to the inferior. Signals not present in the array shall be silently @@ -1708,8 +1707,8 @@ extern void target_pass_signals (int nsig, const unsigned char *pass_signals); example, when detaching (as threads may have been suspended with pending signals not reported to GDB). */ -extern void target_program_signals (int nsig, - const unsigned char *program_signals); +extern void target_program_signals + (gdb::array_view<const unsigned char> program_signals); /* Check to see if a thread is still alive. */ |