diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-12-19 22:18:28 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-02-27 16:54:43 +0200 |
commit | 4133e5a13f15d86bb1f834090de98cca4c34759d (patch) | |
tree | e2926516aff36006f25abb52efb7e9ed16d2520f /gdb | |
parent | 8010f576414759bf5bdcfeaa64226bf03586b763 (diff) | |
download | gdb-4133e5a13f15d86bb1f834090de98cca4c34759d.zip gdb-4133e5a13f15d86bb1f834090de98cca4c34759d.tar.gz gdb-4133e5a13f15d86bb1f834090de98cca4c34759d.tar.bz2 |
gdb/csky: 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.
I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.
gdb/ChangeLog:
* gdb/csky-tdep.c (csky_dummy_id): Delete.
(csky_unwind_pc): Delete.
(csky_unwind_sp): Delete.
(csky_gdbarch_init): Don't register deleted functions with
gdbarch.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/csky-tdep.c | 34 |
2 files changed, 8 insertions, 34 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4d4ad2c..977a138 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 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. + (csky_gdbarch_init): Don't register deleted functions with + gdbarch. + +2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com> + * gdb/cris-tdep.c (cris_dummy_id): Delete. (cris_unwind_pc): Delete. (cris_unwind_sp): Delete. diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index ee17961..cd7d8c5 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -160,14 +160,6 @@ csky_write_pc (regcache *regcache, CORE_ADDR val) regcache_cooked_write_unsigned (regcache, CSKY_PC_REGNUM, val); } -/* Implement the unwind_sp gdbarch method. */ - -static CORE_ADDR -csky_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, CSKY_SP_REGNUM); -} - /* C-Sky ABI register names. */ static const char *csky_register_names[] = @@ -1883,14 +1875,6 @@ csky_frame_unwind_cache (struct frame_info *this_frame) return cache; } -/* Implement the unwind_pc gdbarch method. */ - -static CORE_ADDR -csky_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, CSKY_PC_REGNUM); -} - /* Implement the this_id function for the normal unwinder. */ static void @@ -2045,19 +2029,6 @@ static const struct frame_base csky_frame_base = { csky_frame_base_address }; -/* Implement the dummy_id gdbarch method. The frame ID's base - needs to match the TOS value saved by save_dummy_frame_tos, - and the PC should match the dummy frame's breakpoint. */ - -static struct frame_id -csky_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - unsigned int sp_regnum = CSKY_SP_REGNUM; - - CORE_ADDR sp = get_frame_register_unsigned (this_frame, sp_regnum); - return frame_id_build (sp, get_frame_pc (this_frame)); -} - /* Initialize register access method. */ static void @@ -2245,13 +2216,8 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_align (gdbarch, csky_frame_align); set_gdbarch_stack_frame_destroyed_p (gdbarch, csky_stack_frame_destroyed_p); - /* Functions to access frame data. */ - set_gdbarch_unwind_pc (gdbarch, csky_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, csky_unwind_sp); - /* Functions handling dummy frames. */ set_gdbarch_push_dummy_call (gdbarch, csky_push_dummy_call); - set_gdbarch_dummy_id (gdbarch, csky_dummy_id); /* Frame unwinders. Use DWARF debug info if available, otherwise use our own unwinder. */ |