[14/25] gdb/rs6000: Use default gdbarch methods where possible

Message ID 26eaa8065b1d50f29995454d7efc418b0551fff0.1553721877.git.andrew.burgess@embecosm.com
State New
Headers show
Series
  • Make use of default gdbarch methods for some more targets
Related show

Commit Message

Andrew Burgess March 27, 2019, 9:34 p.m.
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     |  7 +++++++
 gdb/rs6000-tdep.c | 18 ------------------
 2 files changed, 7 insertions(+), 18 deletions(-)

-- 
2.14.5

Comments

Kevin Buettner March 27, 2019, 9:59 p.m. | #1
On Wed, 27 Mar 2019 21:34:10 +0000
Andrew Burgess <andrew.burgess@embecosm.com> wrote:

> gdb/ChangeLog:

> 

> 	* rs6000-tdep.c (rs6000_unwind_pc): Delete.

> 	(rs6000_dummy_id): Delete.

> 	(rs6000_gdbarch_init): Don't register deleted functions with

> 	gdbarch.


Okay.

Patch

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index e875ad95366..fafa715e1af 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3404,20 +3404,6 @@  find_variant_by_arch (enum bfd_architecture arch, unsigned long mach)
 }
 
 
-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
 {
@@ -7103,19 +7089,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);
     }