Patchwork [1/3] gdb/riscv: Remove use of pseudo registers

login
register
mail settings
Submitter Andrew Burgess
Date March 6, 2018, 7:30 p.m.
Message ID <d74aff3d95928db6647a11865c396204c50bc157.1520363647.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/26216/
State New
Headers show

Comments

Andrew Burgess - March 6, 2018, 7:30 p.m.
The code making use of pseudo registers was initially intended to
support running 32-bit ABI files on 64-bit riscv targets.  However, the
implementation was incomplete, and broken.

For now I've removed all reference to pseudo registers from the riscv
target, we've not lost any functionality, and this cleans up failures in
the selftests.

Once the riscv target has matured a little we'll probably end up
bringing back some of the use of pseudo registers in order to better
support running 32-bit executables on a 64-bit target.

gdb/ChangeLog:

	* riscv-tdep.c (riscv_pseudo_register_read): Delete.
	(riscv_pseudo_register_write): Delete.
	(riscv_gdbarch_init): Remove all use of pseudo registers.
---
 gdb/ChangeLog    |  6 ++++++
 gdb/riscv-tdep.c | 25 -------------------------
 2 files changed, 6 insertions(+), 25 deletions(-)

Patch

diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 3e1ad99c673..ce148067216 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -499,28 +499,6 @@  riscv_register_name (struct gdbarch *gdbarch, int regnum)
   return NULL;
 }
 
-/* Implement the pseudo_register_read gdbarch method.  */
-
-static enum register_status
-riscv_pseudo_register_read (struct gdbarch *gdbarch,
-			    readable_regcache *regcache,
-			    int regnum,
-			    gdb_byte *buf)
-{
-  return regcache->raw_read (regnum, buf);
-}
-
-/* Implement the pseudo_register_write gdbarch method.  */
-
-static void
-riscv_pseudo_register_write (struct gdbarch *gdbarch,
-			     struct regcache *regcache,
-			     int cookednum,
-			     const gdb_byte *buf)
-{
-  regcache_raw_write (regcache, cookednum, buf);
-}
-
 /* Implement the register_type gdbarch method.  */
 
 static struct type *
@@ -2559,10 +2537,7 @@  riscv_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, riscv_sw_breakpoint_from_kind);
 
   /* Register architecture.  */
-  set_gdbarch_pseudo_register_read (gdbarch, riscv_pseudo_register_read);
-  set_gdbarch_pseudo_register_write (gdbarch, riscv_pseudo_register_write);
   set_gdbarch_num_regs (gdbarch, RISCV_LAST_REGNUM + 1);
-  set_gdbarch_num_pseudo_regs (gdbarch, RISCV_LAST_REGNUM + 1);
   set_gdbarch_sp_regnum (gdbarch, RISCV_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, RISCV_PC_REGNUM);
   set_gdbarch_ps_regnum (gdbarch, RISCV_FP_REGNUM);