From patchwork Wed Jan 23 18:46:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 31200 Received: (qmail 92375 invoked by alias); 23 Jan 2019 18:46:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 92277 invoked by uid 89); 23 Jan 2019 18:46:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=arrival, Tables, H*MI:sk:2019010 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Jan 2019 18:46:34 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E9F87F3FA; Wed, 23 Jan 2019 18:46:33 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8E1F60C6E; Wed, 23 Jan 2019 18:46:32 +0000 (UTC) Subject: [PATCH] target_pass_signals/target_program_signals: Use gdb::array_view (Re: [PATCH 1/3] Constify target_pass_signals and target_program_signals) To: Tom Tromey , gdb-patches@sourceware.org References: <20190106224636.5271-1-tom@tromey.com> <20190106224636.5271-2-tom@tromey.com> From: Pedro Alves Message-ID: Date: Wed, 23 Jan 2019 18:46:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190106224636.5271-2-tom@tromey.com> On 01/06/2019 10:46 PM, Tom Tromey wrote: > This constifies the final parameter to target_pass_signals and > target_program_signals and updates the rest of gdb. > > Note that I have no way to test the nto-procfs.c change. > > gdb/ChangeLog > 2019-01-06 Tom Tromey > > * target-debug.h (target_debug_print_signals): Constify. > * nto-procfs.c (nto_procfs_target::pass_signals): Update. > * procfs.c (procfs_target::pass_signals): Update. > * linux-nat.c (linux_nat_target::pass_signals): Update. > * linux-nat.h (class linux_nat_target) : Update. > * target-delegates.c: Rebuild. > * remote.c (remote_target::program_signals): Update. > (remote_target::pass_signals): Update. > * target.c (target_pass_signals): Constify argument. > (target_program_signals): Likewise. > * target.h (struct target_ops) : > Constify argument. > (target_pass_signals, target_program_signals): Constify argument. Hmm, this seems to be calling for gdb::array_view. Patch below. WDYT? Having written this, though, I now see that alternatively, I guess we could keep the pointer parameter, but drop the 'int numsigs' parameter and hardcode GDB_SIGNAL_LAST instead of referring to numsigs, since the array size is always going to be GDB_SIGNAL_LAST. From 3aef4262e936b377f391ccbfc3622908b1ce067d Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 23 Jan 2019 18:17:20 +0000 Subject: [PATCH] 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: yyyy-mm-dd Pedro Alves * 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) : Replace pointer and length parameters with gdb::array_view. (target_pass_signals, target_program_signals): Likewise. * target-delegates.c: Regenerate. --- gdb/infrun.c | 42 +++++++++++++++--------------------------- gdb/linux-nat.c | 9 +++++---- gdb/linux-nat.h | 2 +- gdb/nto-procfs.c | 8 ++++---- gdb/procfs.c | 6 +++--- gdb/record-full.c | 2 +- gdb/remote.c | 26 +++++++++++++------------- gdb/target-debug.h | 20 ++++++++------------ gdb/target-delegates.c | 36 ++++++++++++++++-------------------- gdb/target.c | 8 ++++---- gdb/target.h | 17 ++++++++--------- 11 files changed, 78 insertions(+), 98 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index cdfdf49070..f696558a46 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -306,20 +306,19 @@ update_observer_mode (void) /* Tables of how to react to signals; the user sets them. */ -static unsigned char *signal_stop; -static unsigned char *signal_print; -static unsigned char *signal_program; +static unsigned char signal_stop[GDB_SIGNAL_LAST]; +static unsigned char signal_print[GDB_SIGNAL_LAST]; +static unsigned char signal_program[GDB_SIGNAL_LAST]; /* Table of signals that are registered with "catch signal". A non-zero entry indicates that the signal is caught by some "catch - signal" command. This has size GDB_SIGNAL_LAST, to accommodate all - signals. */ -static unsigned char *signal_catch; + signal" command. */ +static unsigned char signal_catch[GDB_SIGNAL_LAST]; /* Table of signals that the target may silently handle. This is automatically determined from the flags above, and simply cached here. */ -static unsigned char *signal_pass; +static unsigned char signal_pass[GDB_SIGNAL_LAST]; #define SET_SIGS(nsigs,sigs,flags) \ do { \ @@ -343,7 +342,7 @@ static unsigned char *signal_pass; void update_signals_program_target (void) { - target_program_signals ((int) GDB_SIGNAL_LAST, signal_program); + target_program_signals (signal_program); } /* Value to pass to target_resume() to cause all threads to resume. */ @@ -2219,9 +2218,9 @@ do_target_resume (ptid_t resume_ptid, int step, enum gdb_signal sig) valid. */ if (step_over_info_valid_p () || displaced_step_in_progress (tp->inf)) - target_pass_signals (0, NULL); + target_pass_signals ({}); else - target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass); + target_pass_signals (signal_pass); target_resume (resume_ptid, step, sig); @@ -8251,7 +8250,7 @@ signal_catch_update (const unsigned int *info) for (i = 0; i < GDB_SIGNAL_LAST; ++i) signal_catch[i] = info[i] > 0; signal_cache_update (-1); - target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass); + target_pass_signals (signal_pass); } static void @@ -8287,8 +8286,6 @@ handle_command (const char *args, int from_tty) int sigfirst, siglast; enum gdb_signal oursig; int allsigs; - int nsigs; - unsigned char *sigs; if (args == NULL) { @@ -8297,9 +8294,8 @@ handle_command (const char *args, int from_tty) /* Allocate and zero an array of flags for which signals to handle. */ - nsigs = (int) GDB_SIGNAL_LAST; - sigs = (unsigned char *) alloca (nsigs); - memset (sigs, 0, nsigs); + const size_t nsigs = GDB_SIGNAL_LAST; + unsigned char sigs[nsigs] {}; /* Break the command line up into args. */ @@ -8436,8 +8432,8 @@ Are you sure you want to change it? "), if (sigs[signum]) { signal_cache_update (-1); - target_pass_signals ((int) GDB_SIGNAL_LAST, signal_pass); - target_program_signals ((int) GDB_SIGNAL_LAST, signal_program); + target_pass_signals (signal_pass); + target_program_signals (signal_program); if (from_tty) { @@ -8963,8 +8959,6 @@ infrun_async_inferior_event_handler (gdb_client_data data) void _initialize_infrun (void) { - int i; - int numsigs; struct cmd_list_element *c; /* Register extra event sources in the event loop. */ @@ -9046,13 +9040,7 @@ leave it stopped or free to run as needed."), &setlist, &showlist); - numsigs = (int) GDB_SIGNAL_LAST; - signal_stop = XNEWVEC (unsigned char, numsigs); - signal_print = XNEWVEC (unsigned char, numsigs); - signal_program = XNEWVEC (unsigned char, numsigs); - signal_catch = XNEWVEC (unsigned char, numsigs); - signal_pass = XNEWVEC (unsigned char, numsigs); - for (i = 0; i < numsigs; i++) + for (size_t i = 0; i < GDB_SIGNAL_LAST; i++) { signal_stop[i] = 1; signal_print[i] = 1; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 45da9fa997..c285e914d5 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 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 { diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index c56a245c8b..16f8a584bd 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -45,7 +45,7 @@ public: ptid_t wait (ptid_t, struct target_waitstatus *, int) override; - void pass_signals (int, const unsigned char *) override; + void pass_signals (gdb::array_view) override; enum target_xfer_status xfer_partial (enum target_object object, const char *annex, diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 9ee42e6428..40959d7715 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -109,7 +109,7 @@ struct nto_procfs_target : public inf_child_target void mourn_inferior () override; - void pass_signals (int, const unsigned char *) override; + void pass_signals (gdb::array_view) override; bool thread_alive (ptid_t ptid) override; @@ -1442,8 +1442,8 @@ nto_procfs_target::store_registers (struct regcache *regcache, int regno) /* Set list of signals to be handled in the target. */ void -nto_procfs_target::pass_signals (int numsigs, - const unsigned char *pass_signals) +nto_procfs_target::pass_signals + (gdb::array_view pass_signals) { int signo; @@ -1452,7 +1452,7 @@ nto_procfs_target::pass_signals (int numsigs, 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]) sigdelset (&run.trace, signo); } } diff --git a/gdb/procfs.c b/gdb/procfs.c index dd7534aa57..3c1dcba062 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -119,7 +119,7 @@ public: ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override; - void pass_signals (int, const unsigned char *) override; + void pass_signals (gdb::array_view) override; void files_info () override; @@ -2772,7 +2772,7 @@ procfs_target::resume (ptid_t ptid, int step, enum gdb_signal signo) /* Set up to trace signals in the child process. */ void -procfs_target::pass_signals (int numsigs, const unsigned char *pass_signals) +procfs_target::pass_signals (gdb::array_view pass_signals) { sigset_t signals; procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0); @@ -2783,7 +2783,7 @@ procfs_target::pass_signals (int numsigs, const unsigned char *pass_signals) for (signo = 0; 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]) prdelset (&signals, signo); } diff --git a/gdb/record-full.c b/gdb/record-full.c index 8738512f28..ea0eddb536 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1098,7 +1098,7 @@ record_full_target::resume (ptid_t ptid, int step, enum gdb_signal signal) } /* Make sure the target beneath reports all signals. */ - target_pass_signals (0, NULL); + target_pass_signals ({}); this->beneath ()->resume (ptid, step, signal); } diff --git a/gdb/remote.c b/gdb/remote.c index 4b3f2907b4..ad53621145 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -472,12 +472,12 @@ public: void mourn_inferior () override; - void pass_signals (int, const unsigned char *) override; + void pass_signals (gdb::array_view) override; int set_syscall_catchpoint (int, bool, int, gdb::array_view) override; - void program_signals (int, const unsigned char *) override; + void program_signals (gdb::array_view) override; bool thread_alive (ptid_t ptid) override; @@ -2560,16 +2560,16 @@ record_currthread (struct remote_state *rs, ptid_t currthread) it can simply pass through to the inferior without reporting. */ void -remote_target::pass_signals (int numsigs, const unsigned char *pass_signals) +remote_target::pass_signals (gdb::array_view pass_signals) { if (packet_support (PACKET_QPassSignals) != PACKET_DISABLE) { char *pass_packet, *p; - int count = 0, i; + int count = 0; struct remote_state *rs = get_remote_state (); - gdb_assert (numsigs < 256); - for (i = 0; i < numsigs; i++) + gdb_assert (pass_signals.size () < 256); + for (size_t i = 0; i < pass_signals.size (); i++) { if (pass_signals[i]) count++; @@ -2577,7 +2577,7 @@ remote_target::pass_signals (int numsigs, const unsigned char *pass_signals) pass_packet = (char *) xmalloc (count * 3 + strlen ("QPassSignals:") + 1); strcpy (pass_packet, "QPassSignals:"); p = pass_packet + strlen (pass_packet); - for (i = 0; i < numsigs; i++) + for (size_t i = 0; i < pass_signals.size (); i++) { if (pass_signals[i]) { @@ -2686,16 +2686,16 @@ remote_target::set_syscall_catchpoint (int pid, bool needed, int any_count, signals it should pass through to the inferior when detaching. */ void -remote_target::program_signals (int numsigs, const unsigned char *signals) +remote_target::program_signals (gdb::array_view signals) { if (packet_support (PACKET_QProgramSignals) != PACKET_DISABLE) { char *packet, *p; - int count = 0, i; + int count = 0; struct remote_state *rs = get_remote_state (); - gdb_assert (numsigs < 256); - for (i = 0; i < numsigs; i++) + gdb_assert (signals.size () < 256); + for (size_t i = 0; i < signals.size (); i++) { if (signals[i]) count++; @@ -2703,7 +2703,7 @@ remote_target::program_signals (int numsigs, const unsigned char *signals) packet = (char *) xmalloc (count * 3 + strlen ("QProgramSignals:") + 1); strcpy (packet, "QProgramSignals:"); p = packet + strlen (packet); - for (i = 0; i < numsigs; i++) + for (size_t i = 0; i < signals.size (); i++) { if (signal_pass_state (i)) { @@ -4796,7 +4796,7 @@ remote_target::start_remote (int from_tty, int extended_p) gdb_assert (wait_status == NULL); /* Report all signals during attach/startup. */ - pass_signals (0, NULL); + pass_signals ({}); /* If there are already stopped threads, mark them stopped and report their stops before giving the prompt to the user. */ diff --git a/gdb/target-debug.h b/gdb/target-debug.h index d51754af59..d9f7d46dd9 100644 --- a/gdb/target-debug.h +++ b/gdb/target-debug.h @@ -209,20 +209,16 @@ target_debug_print_options (int options) } static void -target_debug_print_signals (const unsigned char *sigs) +target_debug_print_signals (gdb::array_view sigs) { fputs_unfiltered ("{", gdb_stdlog); - if (sigs != NULL) - { - int i; - - for (i = 0; i < GDB_SIGNAL_LAST; i++) - if (sigs[i]) - { - fprintf_unfiltered (gdb_stdlog, " %s", - gdb_signal_to_name ((enum gdb_signal) i)); - } - } + + for (size_t i = 0; i < sigs.size (); i++) + if (sigs[i] != 0) + { + fprintf_unfiltered (gdb_stdlog, " %s", + gdb_signal_to_name ((enum gdb_signal) i)); + } fputs_unfiltered (" }", gdb_stdlog); } diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 43c979087f..a25851e9cf 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -62,8 +62,8 @@ struct dummy_target : public target_ops void follow_exec (struct inferior *arg0, char *arg1) override; int set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view arg3) override; void mourn_inferior () override; - void pass_signals (int arg0, const unsigned char * arg1) override; - void program_signals (int arg0, const unsigned char * arg1) override; + void pass_signals (gdb::array_view arg0) override; + void program_signals (gdb::array_view arg0) override; bool thread_alive (ptid_t arg0) override; void update_thread_list () override; const char *pid_to_str (ptid_t arg0) override; @@ -229,8 +229,8 @@ struct debug_target : public target_ops void follow_exec (struct inferior *arg0, char *arg1) override; int set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view arg3) override; void mourn_inferior () override; - void pass_signals (int arg0, const unsigned char * arg1) override; - void program_signals (int arg0, const unsigned char * arg1) override; + void pass_signals (gdb::array_view arg0) override; + void program_signals (gdb::array_view arg0) override; bool thread_alive (ptid_t arg0) override; void update_thread_list () override; const char *pid_to_str (ptid_t arg0) override; @@ -1659,48 +1659,44 @@ debug_target::mourn_inferior () } void -target_ops::pass_signals (int arg0, const unsigned char * arg1) +target_ops::pass_signals (gdb::array_view arg0) { - this->beneath ()->pass_signals (arg0, arg1); + this->beneath ()->pass_signals (arg0); } void -dummy_target::pass_signals (int arg0, const unsigned char * arg1) +dummy_target::pass_signals (gdb::array_view arg0) { } void -debug_target::pass_signals (int arg0, const unsigned char * arg1) +debug_target::pass_signals (gdb::array_view arg0) { fprintf_unfiltered (gdb_stdlog, "-> %s->pass_signals (...)\n", this->beneath ()->shortname ()); - this->beneath ()->pass_signals (arg0, arg1); + this->beneath ()->pass_signals (arg0); fprintf_unfiltered (gdb_stdlog, "<- %s->pass_signals (", this->beneath ()->shortname ()); - target_debug_print_int (arg0); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_signals (arg1); + target_debug_print_signals (arg0); fputs_unfiltered (")\n", gdb_stdlog); } void -target_ops::program_signals (int arg0, const unsigned char * arg1) +target_ops::program_signals (gdb::array_view arg0) { - this->beneath ()->program_signals (arg0, arg1); + this->beneath ()->program_signals (arg0); } void -dummy_target::program_signals (int arg0, const unsigned char * arg1) +dummy_target::program_signals (gdb::array_view arg0) { } void -debug_target::program_signals (int arg0, const unsigned char * arg1) +debug_target::program_signals (gdb::array_view arg0) { fprintf_unfiltered (gdb_stdlog, "-> %s->program_signals (...)\n", this->beneath ()->shortname ()); - this->beneath ()->program_signals (arg0, arg1); + this->beneath ()->program_signals (arg0); fprintf_unfiltered (gdb_stdlog, "<- %s->program_signals (", this->beneath ()->shortname ()); - target_debug_print_int (arg0); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_signals (arg1); + target_debug_print_signals (arg0); fputs_unfiltered (")\n", gdb_stdlog); } diff --git a/gdb/target.c b/gdb/target.c index ad7eba3fa3..6f597a8a1d 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2111,15 +2111,15 @@ make_scoped_defer_target_commit_resume () } void -target_pass_signals (int numsigs, const unsigned char *pass_signals) +target_pass_signals (gdb::array_view pass_signals) { - current_top_target ()->pass_signals (numsigs, pass_signals); + current_top_target ()->pass_signals (pass_signals); } void -target_program_signals (int numsigs, const unsigned char *program_signals) +target_program_signals (gdb::array_view program_signals) { - current_top_target ()->program_signals (numsigs, program_signals); + current_top_target ()->program_signals (program_signals); } static int diff --git a/gdb/target.h b/gdb/target.h index 14ec07fc0e..d04465a58b 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 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 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 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 program_signals); /* Check to see if a thread is still alive. */