]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/cris: Use default gdbarch methods where possible
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sun, 9 Sep 2018 16:17:05 +0000 (17:17 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 27 Feb 2019 14:54:43 +0000 (16:54 +0200)
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.

gdb/ChangeLog
gdb/cris-tdep.c

index 4b4d33850dd1ed5823cb36022d9cc2f8548e1beb..4d4ad2c2c224651db3e780e6f4e9c6efaa8612d4 100644 (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.
index 48bdcac6a22cba9f81c9861a7e23b0e109329d1d..8eda05806f819f9fda0de37f55f222748b5daaff 100644 (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.  */