aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-01-10 18:55:23 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-04-23 22:50:26 +0100
commit96acf8844a655e34de3f3b014a7f64f26266dee1 (patch)
tree98a6f7f85bff364e00a054fabd869c0b57aa41a2
parentca0ab0aa8194eda711cf52efe6c26cb821218476 (diff)
downloadgdb-96acf8844a655e34de3f3b014a7f64f26266dee1.zip
gdb-96acf8844a655e34de3f3b014a7f64f26266dee1.tar.gz
gdb-96acf8844a655e34de3f3b014a7f64f26266dee1.tar.bz2
gdb/nios2: Use default gdbarch methods where possible
Make use of the default gdbarch methods for gdbarch_dummy_id, 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: * nios2-tdep.c (nios2_dummy_id): Delete. (nios2_unwind_sp): Delete. (nios2_gdbarch_init): Don't register deleted functions with gdbarch.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/nios2-tdep.c20
2 files changed, 7 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bf09186..a730d5f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
+ * nios2-tdep.c (nios2_dummy_id): Delete.
+ (nios2_unwind_sp): Delete.
+ (nios2_gdbarch_init): Don't register deleted functions with
+ gdbarch.
+
+2019-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
+
* nds32-tdep.c (nds32_dummy_id): Delete.
(nds32_unwind_pc): Delete.
(nds32_unwind_sp): Delete.
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 0866454..2a21c33 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -1795,16 +1795,6 @@ nios2_return_value (struct gdbarch *gdbarch, struct value *function,
return RETURN_VALUE_REGISTER_CONVENTION;
}
-/* Implement the dummy_id gdbarch method. */
-
-static struct frame_id
-nios2_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- return frame_id_build
- (get_frame_register_unsigned (this_frame, NIOS2_SP_REGNUM),
- get_frame_pc (this_frame));
-}
-
/* Implement the push_dummy_call gdbarch method. */
static CORE_ADDR
@@ -1896,14 +1886,6 @@ nios2_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
return extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
}
-/* Implement the unwind_sp gdbarch method. */
-
-static CORE_ADDR
-nios2_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- return frame_unwind_register_unsigned (this_frame, NIOS2_SP_REGNUM);
-}
-
/* Use prologue analysis to fill in the register cache
*THIS_PROLOGUE_CACHE for THIS_FRAME. This function initializes
*THIS_PROLOGUE_CACHE first. */
@@ -2375,9 +2357,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_kind_from_pc (gdbarch, nios2_breakpoint_kind_from_pc);
set_gdbarch_sw_breakpoint_from_kind (gdbarch, nios2_sw_breakpoint_from_kind);
- set_gdbarch_dummy_id (gdbarch, nios2_dummy_id);
set_gdbarch_unwind_pc (gdbarch, nios2_unwind_pc);
- set_gdbarch_unwind_sp (gdbarch, nios2_unwind_sp);
/* The dwarf2 unwinder will normally produce the best results if
the debug information is available, so register it first. */