diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-01-10 20:12:28 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-04-23 22:50:28 +0100 |
commit | 47c47d6907bc44a599baff948d2809616c74c44e (patch) | |
tree | 2a2000ccbe03a238b65cbb035b8d92d449a37e88 /gdb | |
parent | 833a4480dd7cadfd645d7b141168a0e22dc50665 (diff) | |
download | gdb-47c47d6907bc44a599baff948d2809616c74c44e.zip gdb-47c47d6907bc44a599baff948d2809616c74c44e.tar.gz gdb-47c47d6907bc44a599baff948d2809616c74c44e.tar.bz2 |
gdb/rx: 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:
* rx-tdep.c (rx_unwind_pc): Delete.
(rx_unwind_sp): Delete.
(rx_dummy_id): Delete.
(rx_gdbarch_init): Don't register deleted functions with
gdbarch. Update comment.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/rx-tdep.c | 38 |
2 files changed, 10 insertions, 36 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c8fcce..66193f0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com> + * rx-tdep.c (rx_unwind_pc): Delete. + (rx_unwind_sp): Delete. + (rx_dummy_id): Delete. + (rx_gdbarch_init): Don't register deleted functions with + gdbarch. Update comment. + +2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com> + * rs6000-tdep.c (rs6000_unwind_pc): Delete. (rs6000_dummy_id): Delete. (rs6000_gdbarch_init): Don't register deleted functions with diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 2825c79..4cbf919 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -751,35 +751,6 @@ static const struct frame_unwind rx_exception_unwind = { rx_exception_sniffer }; -/* Implement the "unwind_pc" gdbarch method. */ -static CORE_ADDR -rx_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - ULONGEST pc; - - pc = frame_unwind_register_unsigned (this_frame, RX_PC_REGNUM); - return pc; -} - -/* Implement the "unwind_sp" gdbarch method. */ -static CORE_ADDR -rx_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - ULONGEST sp; - - sp = frame_unwind_register_unsigned (this_frame, RX_SP_REGNUM); - return sp; -} - -/* Implement the "dummy_id" gdbarch method. */ -static struct frame_id -rx_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return - frame_id_build (get_frame_register_unsigned (this_frame, RX_SP_REGNUM), - get_frame_pc (this_frame)); -} - /* Implement the "push_dummy_call" gdbarch method. */ static CORE_ADDR rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -1112,9 +1083,6 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sw_breakpoint_from_kind (gdbarch, rx_breakpoint::bp_from_kind); set_gdbarch_skip_prologue (gdbarch, rx_skip_prologue); - set_gdbarch_unwind_pc (gdbarch, rx_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, rx_unwind_sp); - /* Target builtin data types. */ set_gdbarch_char_signed (gdbarch, 0); set_gdbarch_short_bit (gdbarch, 16); @@ -1147,10 +1115,8 @@ rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, &rx_frame_unwind); - /* Methods for saving / extracting a dummy frame's ID. - The ID's stack address must match the SP value returned by - PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ - set_gdbarch_dummy_id (gdbarch, rx_dummy_id); + /* Methods setting up a dummy call, and extracting the return value from + a call. */ set_gdbarch_push_dummy_call (gdbarch, rx_push_dummy_call); set_gdbarch_return_value (gdbarch, rx_return_value); |