From patchwork Tue Jul 16 00:23:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 33695 Received: (qmail 124036 invoked by alias); 16 Jul 2019 00:25:37 -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 124020 invoked by uid 89); 16 Jul 2019 00:25:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy= X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Jul 2019 00:25:34 +0000 Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 42AB310B76C for ; Mon, 15 Jul 2019 20:25:32 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PUSHED OBV] Fix build for aarch64, arm, and riscv FreeBSD native targets. Date: Mon, 15 Jul 2019 17:23:42 -0700 Message-Id: <20190716002342.41815-2-jhb@FreeBSD.org> In-Reply-To: <20190716002342.41815-1-jhb@FreeBSD.org> References: <20190716002342.41815-1-jhb@FreeBSD.org> MIME-Version: 1.0 X-IsSubscribed: yes Remove unused gdbarch argument to helper functions originally copied from mips-fbsd-nat.c. Include regcache.h previously included from defs.h via gdbarch.h. gdb/ChangeLog: * aarch64-fbsd-nat.c: Include regcache.h. (getregs_supplies, getfpregs_supplies): Remove unused gdbarch argument. (aarch64_fbsd_nat_target::fetch_registers) (aarch64_fbsd_nat_target::store_registers): Remove gdbarch variable. * arm-fbsd-nat.c, riscv-fbsd-nat.c: Likewise. --- gdb/ChangeLog | 10 ++++++++++ gdb/aarch64-fbsd-nat.c | 15 +++++++-------- gdb/arm-fbsd-nat.c | 14 ++++++-------- gdb/riscv-fbsd-nat.c | 15 +++++++-------- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5e086ca15a..a46a1f52ef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2019-07-16 John Baldwin + + * aarch64-fbsd-nat.c: Include regcache.h. + (getregs_supplies, getfpregs_supplies): Remove unused gdbarch + argument. + (aarch64_fbsd_nat_target::fetch_registers) + (aarch64_fbsd_nat_target::store_registers): Remove gdbarch + variable. + * arm-fbsd-nat.c, riscv-fbsd-nat.c: Likewise. + 2019-07-16 John Baldwin * fbsd-nat.c: Include gdbarch.h. diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c index bb187a600d..3c3931f6b7 100644 --- a/gdb/aarch64-fbsd-nat.c +++ b/gdb/aarch64-fbsd-nat.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "defs.h" +#include "regcache.h" #include "target.h" #include @@ -40,7 +41,7 @@ static aarch64_fbsd_nat_target the_aarch64_fbsd_nat_target; /* Determine if PT_GETREGS fetches REGNUM. */ static bool -getregs_supplies (struct gdbarch *gdbarch, int regnum) +getregs_supplies (int regnum) { return (regnum >= AARCH64_X0_REGNUM && regnum <= AARCH64_CPSR_REGNUM); } @@ -48,7 +49,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regnum) /* Determine if PT_GETFPREGS fetches REGNUM. */ static bool -getfpregs_supplies (struct gdbarch *gdbarch, int regnum) +getfpregs_supplies (int regnum) { return (regnum >= AARCH64_V0_REGNUM && regnum <= AARCH64_FPCR_REGNUM); } @@ -62,8 +63,7 @@ aarch64_fbsd_nat_target::fetch_registers (struct regcache *regcache, { pid_t pid = get_ptrace_pid (regcache->ptid ()); - struct gdbarch *gdbarch = regcache->arch (); - if (regnum == -1 || getregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getregs_supplies (regnum)) { struct reg regs; @@ -74,7 +74,7 @@ aarch64_fbsd_nat_target::fetch_registers (struct regcache *regcache, sizeof (regs)); } - if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getfpregs_supplies (regnum)) { struct fpreg fpregs; @@ -95,8 +95,7 @@ aarch64_fbsd_nat_target::store_registers (struct regcache *regcache, { pid_t pid = get_ptrace_pid (regcache->ptid ()); - struct gdbarch *gdbarch = regcache->arch (); - if (regnum == -1 || getregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getregs_supplies (regnum)) { struct reg regs; @@ -110,7 +109,7 @@ aarch64_fbsd_nat_target::store_registers (struct regcache *regcache, perror_with_name (_("Couldn't write registers")); } - if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getfpregs_supplies (regnum)) { struct fpreg fpregs; diff --git a/gdb/arm-fbsd-nat.c b/gdb/arm-fbsd-nat.c index f85ecc17c0..e6c7d3c4a8 100644 --- a/gdb/arm-fbsd-nat.c +++ b/gdb/arm-fbsd-nat.c @@ -41,7 +41,7 @@ static arm_fbsd_nat_target the_arm_fbsd_nat_target; /* Determine if PT_GETREGS fetches REGNUM. */ static bool -getregs_supplies (struct gdbarch *gdbarch, int regnum) +getregs_supplies (int regnum) { return ((regnum >= ARM_A1_REGNUM && regnum <= ARM_PC_REGNUM) || regnum == ARM_PS_REGNUM); @@ -51,7 +51,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regnum) /* Determine if PT_GETVFPREGS fetches REGNUM. */ static bool -getvfpregs_supplies (struct gdbarch *gdbarch, int regnum) +getvfpregs_supplies (int regnum) { return ((regnum >= ARM_D0_REGNUM && regnum <= ARM_D31_REGNUM) || regnum == ARM_FPSCR_REGNUM); @@ -66,8 +66,7 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { pid_t pid = get_ptrace_pid (regcache->ptid ()); - struct gdbarch *gdbarch = regcache->arch (); - if (regnum == -1 || getregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getregs_supplies (regnum)) { struct reg regs; @@ -79,7 +78,7 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) } #ifdef PT_GETVFPREGS - if (regnum == -1 || getvfpregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getvfpregs_supplies (regnum)) { struct vfpreg vfpregs; @@ -100,8 +99,7 @@ arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { pid_t pid = get_ptrace_pid (regcache->ptid ()); - struct gdbarch *gdbarch = regcache->arch (); - if (regnum == -1 || getregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getregs_supplies (regnum)) { struct reg regs; @@ -116,7 +114,7 @@ arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) } #ifdef PT_GETVFPREGS - if (regnum == -1 || getvfpregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getvfpregs_supplies (regnum)) { struct vfpreg vfpregs; diff --git a/gdb/riscv-fbsd-nat.c b/gdb/riscv-fbsd-nat.c index f4850842a1..24381e0dcc 100644 --- a/gdb/riscv-fbsd-nat.c +++ b/gdb/riscv-fbsd-nat.c @@ -18,6 +18,7 @@ along with this program. If not, see . */ #include "defs.h" +#include "regcache.h" #include "target.h" #include @@ -40,7 +41,7 @@ static riscv_fbsd_nat_target the_riscv_fbsd_nat_target; /* Determine if PT_GETREGS fetches REGNUM. */ static bool -getregs_supplies (struct gdbarch *gdbarch, int regnum) +getregs_supplies (int regnum) { return ((regnum >= RISCV_RA_REGNUM && regnum <= RISCV_PC_REGNUM) || regnum == RISCV_CSR_SSTATUS_REGNUM); @@ -49,7 +50,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regnum) /* Determine if PT_GETFPREGS fetches REGNUM. */ static bool -getfpregs_supplies (struct gdbarch *gdbarch, int regnum) +getfpregs_supplies (int regnum) { return ((regnum >= RISCV_FIRST_FP_REGNUM && regnum <= RISCV_LAST_FP_REGNUM) || regnum == RISCV_CSR_FCSR_REGNUM); @@ -64,10 +65,9 @@ riscv_fbsd_nat_target::fetch_registers (struct regcache *regcache, { pid_t pid = get_ptrace_pid (regcache->ptid ()); - struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || regnum == RISCV_ZERO_REGNUM) regcache->raw_supply_zeroed (RISCV_ZERO_REGNUM); - if (regnum == -1 || getregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getregs_supplies (regnum)) { struct reg regs; @@ -78,7 +78,7 @@ riscv_fbsd_nat_target::fetch_registers (struct regcache *regcache, sizeof (regs)); } - if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getfpregs_supplies (regnum)) { struct fpreg fpregs; @@ -99,8 +99,7 @@ riscv_fbsd_nat_target::store_registers (struct regcache *regcache, { pid_t pid = get_ptrace_pid (regcache->ptid ()); - struct gdbarch *gdbarch = regcache->arch (); - if (regnum == -1 || getregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getregs_supplies (regnum)) { struct reg regs; @@ -114,7 +113,7 @@ riscv_fbsd_nat_target::store_registers (struct regcache *regcache, perror_with_name (_("Couldn't write registers")); } - if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) + if (regnum == -1 || getfpregs_supplies (regnum)) { struct fpreg fpregs;