gdb/rs6000: Use default gdbarch methods where possible
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 10 Jan 2019 20:08:18 +0000 (20:08 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 23 Apr 2019 21:50:27 +0000 (22:50 +0100)
Make use of the default gdbarch methods for gdbarch_dummy_id,
gdbarch_unwind_pc 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:

* rs6000-tdep.c (rs6000_unwind_pc): Delete.
(rs6000_dummy_id): Delete.
(rs6000_gdbarch_init): Don't register deleted functions with
gdbarch.

gdb/ChangeLog
gdb/rs6000-tdep.c

index 5eb9715c9438bc8f145a5ba8727b4d99ebf1b004..0c8fcced6813751f7edc0dbd60506b2b48a02c8d 100644 (file)
@@ -1,3 +1,10 @@
+2019-04-23  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * rs6000-tdep.c (rs6000_unwind_pc): Delete.
+       (rs6000_dummy_id): Delete.
+       (rs6000_gdbarch_init): Don't register deleted functions with
+       gdbarch.
+
 2019-04-23  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * or1k-tdep.c (or1k_dummy_id): Delete.
index 375b960f0bab2288e65092e9240bbe7cf90dd02c..328b41cc595c2257e708ef2ebcf8764f1ffec5d0 100644 (file)
@@ -3404,20 +3404,6 @@ find_variant_by_arch (enum bfd_architecture arch, unsigned long mach)
 }
 
 \f
-static CORE_ADDR
-rs6000_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame,
-                                        gdbarch_pc_regnum (gdbarch));
-}
-
-static struct frame_id
-rs6000_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_id_build (get_frame_register_unsigned
-                         (this_frame, gdbarch_sp_regnum (gdbarch)),
-                        get_frame_pc (this_frame));
-}
 
 struct rs6000_frame_cache
 {
@@ -7101,19 +7087,15 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     case GDB_OSABI_LINUX:
     case GDB_OSABI_NETBSD:
     case GDB_OSABI_UNKNOWN:
-      set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc);
       frame_unwind_append_unwinder (gdbarch, &rs6000_epilogue_frame_unwind);
       frame_unwind_append_unwinder (gdbarch, &rs6000_frame_unwind);
-      set_gdbarch_dummy_id (gdbarch, rs6000_dummy_id);
       frame_base_append_sniffer (gdbarch, rs6000_frame_base_sniffer);
       break;
     default:
       set_gdbarch_believe_pcc_promotion (gdbarch, 1);
 
-      set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc);
       frame_unwind_append_unwinder (gdbarch, &rs6000_epilogue_frame_unwind);
       frame_unwind_append_unwinder (gdbarch, &rs6000_frame_unwind);
-      set_gdbarch_dummy_id (gdbarch, rs6000_dummy_id);
       frame_base_append_sniffer (gdbarch, rs6000_frame_base_sniffer);
     }