From: Andrew Burgess Date: Thu, 10 Jan 2019 20:15:03 +0000 (+0000) Subject: gdb/score: Use default gdbarch methods where possible X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a40dde9db56ffcea8c2b99e8c4e292ce64f64f9c;p=binutils-gdb.git gdb/score: 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: * score-tdep.c (score_unwind_sp): Delete. (score_unwind_pc): Delete. (score_dummy_id): Delete. (score_gdbarch_init): Don't register deleted functions with gdbarch. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 66193f0fa40..89b65eabbb0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2019-04-23 Andrew Burgess + + * score-tdep.c (score_unwind_sp): Delete. + (score_unwind_pc): Delete. + (score_dummy_id): Delete. + (score_gdbarch_init): Don't register deleted functions with + gdbarch. + 2019-04-23 Andrew Burgess * rx-tdep.c (rx_unwind_pc): Delete. diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 02f4ed4a12b..19306d3464e 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -64,18 +64,6 @@ score_register_type (struct gdbarch *gdbarch, int regnum) return builtin_type (gdbarch)->builtin_uint32; } -static CORE_ADDR -score_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, SCORE_SP_REGNUM); -} - -static CORE_ADDR -score_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_unwind_register_unsigned (next_frame, SCORE_PC_REGNUM); -} - static const char * score7_register_name (struct gdbarch *gdbarch, int regnum) { @@ -478,14 +466,6 @@ score_return_value (struct gdbarch *gdbarch, struct value *function, } } -static struct frame_id -score_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) -{ - return frame_id_build (get_frame_register_unsigned (this_frame, - SCORE_SP_REGNUM), - get_frame_pc (this_frame)); -} - static int score_type_needs_double_align (struct type *type) { @@ -1480,8 +1460,6 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, score_register_type); set_gdbarch_frame_align (gdbarch, score_frame_align); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_unwind_sp (gdbarch, score_unwind_sp); - set_gdbarch_unwind_pc (gdbarch, score_unwind_pc); switch (target_mach) { @@ -1519,7 +1497,6 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Dummy frame hooks. */ set_gdbarch_return_value (gdbarch, score_return_value); set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); - set_gdbarch_dummy_id (gdbarch, score_dummy_id); set_gdbarch_push_dummy_call (gdbarch, score_push_dummy_call); /* Normal frame hooks. */