gdb/cris: 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/cris-tdep.c (cris_dummy_id): Delete.
	(cris_unwind_pc): Delete.
	(cris_unwind_sp): Delete.
	(cris_gdbarch_init): Don't register deleted functions with
	gdbarch.
This commit is contained in:
Andrew Burgess 2018-09-09 17:17:05 +01:00
parent b56bf08443
commit 8010f57641
2 changed files with 8 additions and 40 deletions

View File

@ -1,3 +1,11 @@
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.
(cris_gdbarch_init): Don't register deleted functions with
gdbarch.
2019-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb/bfin-tdep.c (bfin_dummy_id): Delete.

View File

@ -651,12 +651,6 @@ static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc,
struct frame_info *this_frame,
struct cris_unwind_cache *info);
static CORE_ADDR cris_unwind_pc (struct gdbarch *gdbarch,
struct frame_info *next_frame);
static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch,
struct frame_info *next_frame);
/* When arguments must be pushed onto the stack, they go on in reverse
order. The below implements a FILO (stack) to do this.
Copied from d10v-tdep.c. */
@ -767,18 +761,6 @@ cris_frame_prev_register (struct frame_info *this_frame,
return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
}
/* Assuming THIS_FRAME is a dummy, return the frame ID of that dummy
frame. The frame ID's base needs to match the TOS value saved by
save_dummy_frame_tos(), and the PC match the dummy frame's breakpoint. */
static struct frame_id
cris_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
{
CORE_ADDR sp;
sp = get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch));
return frame_id_build (sp, get_frame_pc (this_frame));
}
static CORE_ADDR
cris_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
@ -1372,24 +1354,6 @@ cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
return pc_after_prologue;
}
static CORE_ADDR
cris_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
ULONGEST pc;
pc = frame_unwind_register_unsigned (next_frame,
gdbarch_pc_regnum (gdbarch));
return pc;
}
static CORE_ADDR
cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
ULONGEST sp;
sp = frame_unwind_register_unsigned (next_frame,
gdbarch_sp_regnum (gdbarch));
return sp;
}
/* Implement the breakpoint_kind_from_pc gdbarch method. */
static int
@ -4095,10 +4059,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc);
set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind);
set_gdbarch_unwind_pc (gdbarch, cris_unwind_pc);
set_gdbarch_unwind_sp (gdbarch, cris_unwind_sp);
set_gdbarch_dummy_id (gdbarch, cris_dummy_id);
if (tdep->cris_dwarf2_cfi == 1)
{
/* Hook in the Dwarf-2 frame sniffer. */