aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2018-09-09 17:07:16 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-02-27 16:54:43 +0200
commitf8278c3c7e0212e810fa7d65f6202b607c9cf3ca (patch)
tree602a82f0d1842b9afccf4a590d380f675a880e0c /gdb
parent480e46cfc5cf4976c1f1a00bc6254d78e9c45447 (diff)
downloadgdb-f8278c3c7e0212e810fa7d65f6202b607c9cf3ca.zip
gdb-f8278c3c7e0212e810fa7d65f6202b607c9cf3ca.tar.gz
gdb-f8278c3c7e0212e810fa7d65f6202b607c9cf3ca.tar.bz2
gdb/arc: 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. The only difference is that the old ARC specific methods had additional debugging, however, this was discussed on the mailing list[1] and it was agreed these methods could be removed. [1] https://sourceware.org/ml/gdb-patches/2018-12/msg00386.html gdb/ChangeLog: * gdb/arc-tdep.c (arc_dummy_id): Delete. (arc_unwind_pc): Delete. (arc_unwind_sp): Delete. (arc_gdbarch_init): Don't register deleted functions with gdbarch.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/arc-tdep.c45
2 files changed, 7 insertions, 45 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 42742f1..05c5f87 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
+ * gdb/arc-tdep.c (arc_dummy_id): Delete.
+ (arc_unwind_pc): Delete.
+ (arc_unwind_sp): Delete.
+ (arc_gdbarch_init): Don't register deleted functions with gdbarch.
+
+2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
+
* gdb/alpha-tdep.c (alpha_dummy_id): Delete.
(alpha_unwind_pc): Delete.
(alpha_gdbarch_init): Don't register deleted functions with
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 235fb27..009af11 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -509,19 +509,6 @@ arc_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
*offset_ptr = 0;
}
-/* Implement the "dummy_id" gdbarch method.
-
- Tear down a dummy frame created by arc_push_dummy_call (). This data has
- to be constructed manually from the data in our hand. The stack pointer
- and program counter can be obtained from the frame info. */
-
-static struct frame_id
-arc_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
- return frame_id_build (get_frame_sp (this_frame),
- get_frame_pc (this_frame));
-}
-
/* Implement the "push_dummy_call" gdbarch method.
Stack Frame Layout
@@ -1512,34 +1499,6 @@ arc_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
}
}
-/* Implement the "unwind_pc" gdbarch method. */
-
-static CORE_ADDR
-arc_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- int pc_regnum = gdbarch_pc_regnum (gdbarch);
- CORE_ADDR pc = frame_unwind_register_unsigned (next_frame, pc_regnum);
-
- if (arc_debug)
- debug_printf ("arc: unwind PC: %s\n", paddress (gdbarch, pc));
-
- return pc;
-}
-
-/* Implement the "unwind_sp" gdbarch method. */
-
-static CORE_ADDR
-arc_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
- int sp_regnum = gdbarch_sp_regnum (gdbarch);
- CORE_ADDR sp = frame_unwind_register_unsigned (next_frame, sp_regnum);
-
- if (arc_debug)
- debug_printf ("arc: unwind SP: %s\n", paddress (gdbarch, sp));
-
- return sp;
-}
-
/* Implement the "frame_align" gdbarch method. */
static CORE_ADDR
@@ -2034,7 +1993,6 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_ps_regnum (gdbarch, ARC_STATUS32_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, -1); /* No FPU registers. */
- set_gdbarch_dummy_id (gdbarch, arc_dummy_id);
set_gdbarch_push_dummy_call (gdbarch, arc_push_dummy_call);
set_gdbarch_push_dummy_code (gdbarch, arc_push_dummy_code);
@@ -2057,9 +2015,6 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
else
set_gdbarch_decr_pc_after_break (gdbarch, 2);
- set_gdbarch_unwind_pc (gdbarch, arc_unwind_pc);
- set_gdbarch_unwind_sp (gdbarch, arc_unwind_sp);
-
set_gdbarch_frame_align (gdbarch, arc_frame_align);
set_gdbarch_print_insn (gdbarch, arc_delayed_print_insn);