aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-12-19 22:24:22 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-02-27 16:54:43 +0200
commit76055cbe88cc6623f88c8ae43ed8b8ae6883df9e (patch)
tree8fee1681999c7337af6c11e50a1b5b03c3945602 /gdb
parent4133e5a13f15d86bb1f834090de98cca4c34759d (diff)
downloadgdb-76055cbe88cc6623f88c8ae43ed8b8ae6883df9e.zip
gdb-76055cbe88cc6623f88c8ae43ed8b8ae6883df9e.tar.gz
gdb-76055cbe88cc6623f88c8ae43ed8b8ae6883df9e.tar.bz2
gdb/riscv: Use default gdbarch methods where possible
Make use of the default gdbarch methods for gdbarch_dummy_id, gdbarch_unwind_pc, and gdbarch_unwind_sp where possible. This change has been tested with no regressions. gdb/ChangeLog: * gdb/riscv-tdep.c (riscv_dummy_id): Delete. (riscv_unwind_pc): Delete. (riscv_unwind_sp): Delete. (riscv_gdbarch_init): Don't register deleted functions with gdbarch.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/riscv-tdep.c30
2 files changed, 8 insertions, 30 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 977a138..49e312f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
+ * gdb/riscv-tdep.c (riscv_dummy_id): Delete.
+ (riscv_unwind_pc): Delete.
+ (riscv_unwind_sp): Delete.
+ (riscv_gdbarch_init): Don't register deleted functions with
+ gdbarch.
+
+2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
+
* gdb/csky-tdep.c (csky_dummy_id): Delete.
(csky_unwind_pc): Delete.
(csky_unwind_sp): Delete.
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 3e8f564..8a996f3 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -2731,31 +2731,6 @@ riscv_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
return align_down (addr, 16);
}
-/* Implement the unwind_pc gdbarch method. */
-
-static CORE_ADDR
-riscv_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- return frame_unwind_register_unsigned (next_frame, RISCV_PC_REGNUM);
-}
-
-/* Implement the unwind_sp gdbarch method. */
-
-static CORE_ADDR
-riscv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- return frame_unwind_register_unsigned (next_frame, RISCV_SP_REGNUM);
-}
-
-/* Implement the dummy_id gdbarch method. */
-
-static struct frame_id
-riscv_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- return frame_id_build (get_frame_register_signed (this_frame, RISCV_SP_REGNUM),
- get_frame_pc (this_frame));
-}
-
/* Generate, or return the cached frame cache for the RiscV frame
unwinder. */
@@ -3193,15 +3168,10 @@ riscv_gdbarch_init (struct gdbarch_info info,
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_frame_align (gdbarch, riscv_frame_align);
- /* Functions to access frame data. */
- set_gdbarch_unwind_pc (gdbarch, riscv_unwind_pc);
- set_gdbarch_unwind_sp (gdbarch, riscv_unwind_sp);
-
/* Functions handling dummy frames. */
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_push_dummy_code (gdbarch, riscv_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, riscv_push_dummy_call);
- set_gdbarch_dummy_id (gdbarch, riscv_dummy_id);
/* Frame unwinders. Use DWARF debug info if available, otherwise use our own
unwinder. */