Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 6 Nov 2018 17:47:21 +0000 (09:47 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 6 Nov 2018 17:47:21 +0000 (09:47 -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.

gdb/ChangeLog
gdb/riscv-fbsd-nat.c

index 4755ba915403928c0872a4adb07c50c6340ecdc4..68ecef7728b1dc9d536d434e1ba6f59dae896ff5 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-06  John Baldwin  <jhb@FreeBSD.org>
+
+       * riscv-fbsd-nat.c (getregs_supplies): Return true for
+       RISCV_CSR_SSTATUS_REGNUM.
+
 2018-11-04  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
        * source.c (open_source_file): Fix leak by transferring the
index ad4ea1e0ad1d70651297764f0073295e96153e11..e66f491284cb9016c11738c94af85e0f06f181c0 100644 (file)
@@ -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.  */