From: Andrew Burgess Date: Tue, 6 Mar 2018 16:19:52 +0000 (+0000) Subject: gdb/riscv: Remove use of pseudo registers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d74aff3d95928db6647a11865c396204c50bc157;p=binutils-gdb.git gdb/riscv: Remove use of pseudo registers 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8e78518ff67..909178fc156 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-03-06 Andrew Burgess + + * riscv-tdep.c (riscv_pseudo_register_read): Delete. + (riscv_pseudo_register_write): Delete. + (riscv_gdbarch_init): Remove all use of pseudo registers. + 2018-03-06 Simon Marchi * record-btrace.c (btrace_print_lines): Replace cleanup 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);