* [PATCH] Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv.
@ 2018-11-05 21:57 John Baldwin
2018-11-05 22:35 ` Andrew Burgess
0 siblings, 1 reply; 2+ messages in thread
From: John Baldwin @ 2018-11-05 21:57 UTC (permalink / raw)
To: gdb-patches
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 <jhb@FreeBSD.org>
+
+ * riscv-fbsd-nat.c (getregs_supplies): Return true for
+ RISCV_CSR_SSTATUS_REGNUM.
+
2018-11-04 Tom Tromey <tom@tromey.com>
* 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. */
--
2.18.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv.
2018-11-05 21:57 [PATCH] Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv John Baldwin
@ 2018-11-05 22:35 ` Andrew Burgess
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Burgess @ 2018-11-05 22:35 UTC (permalink / raw)
To: John Baldwin; +Cc: gdb-patches
* John Baldwin <jhb@FreeBSD.org> [2018-11-05 13:57:23 -0800]:
> 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.
Looks good. Thanks,
Andrew
> ---
> 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 <jhb@FreeBSD.org>
> +
> + * riscv-fbsd-nat.c (getregs_supplies): Return true for
> + RISCV_CSR_SSTATUS_REGNUM.
> +
> 2018-11-04 Tom Tromey <tom@tromey.com>
>
> * 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. */
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-05 22:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 21:57 [PATCH] Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv John Baldwin
2018-11-05 22:35 ` Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox