From patchwork Mon Nov 5 21:57:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 30030 Received: (qmail 62968 invoked by alias); 5 Nov 2018 21:57:34 -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 62946 invoked by uid 89); 5 Nov 2018 21:57:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=supplies 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; Mon, 05 Nov 2018 21:57:31 +0000 Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id F2EAC10AFCD for ; Mon, 5 Nov 2018 16:57:28 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH] Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv. Date: Mon, 5 Nov 2018 13:57:23 -0800 Message-Id: <20181105215723.23683-1-jhb@FreeBSD.org> X-IsSubscribed: yes This permits reading the value of the SSTATUS CSR returned by ptrace() for live FreeBSD/riscv processes. * riscv-fbsd-nat.c (getregs_supplies): Return true for RISCV_CSR_SSTATUS_REGNUM. --- gdb/ChangeLog | 5 +++++ gdb/riscv-fbsd-nat.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bc77fe85c7..b78d58625e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-11-05 John Baldwin + + * riscv-fbsd-nat.c (getregs_supplies): Return true for + RISCV_CSR_SSTATUS_REGNUM. + 2018-11-04 Tom Tromey * varobj.c (install_default_visualizer): Update. diff --git a/gdb/riscv-fbsd-nat.c b/gdb/riscv-fbsd-nat.c index ad4ea1e0ad..e66f491284 100644 --- a/gdb/riscv-fbsd-nat.c +++ b/gdb/riscv-fbsd-nat.c @@ -42,7 +42,8 @@ static riscv_fbsd_nat_target the_riscv_fbsd_nat_target; static bool getregs_supplies (struct gdbarch *gdbarch, int regnum) { - return (regnum >= RISCV_RA_REGNUM && regnum <= RISCV_PC_REGNUM); + return ((regnum >= RISCV_RA_REGNUM && regnum <= RISCV_PC_REGNUM) + || regnum == RISCV_CSR_SSTATUS_REGNUM); } /* Determine if PT_GETFPREGS fetches REGNUM. */