This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 07/25] gdb/mips: Use default gdbarch methods where possible


Make use of the default gdbarch methods for gdbarch_dummy_id, 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.

One thing worth noting in this commit is that the accesses to the
stack pointer register changes from being signed to unsigned, however,
in all cases the register is immediately converted to a CORE_ADDR, so
I don't think this will cause any problems.

gdb/ChangeLog:

	* mips-tdep.c (mips_unwind_sp): Delete.
	(mips_dummy_id): Delete.
	(mips_gdbarch_init): Don't register deleted functions with
	gdbarch.
---
 gdb/ChangeLog   |  7 +++++++
 gdb/mips-tdep.c | 24 ------------------------
 2 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index f3361388225..91cc188bdda 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -1403,28 +1403,6 @@ mips_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
   return pc;
 }
 
-static CORE_ADDR
-mips_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_signed
-	   (next_frame, gdbarch_num_regs (gdbarch) + MIPS_SP_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
-mips_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_id_build
-	   (get_frame_register_signed (this_frame,
-				       gdbarch_num_regs (gdbarch)
-				       + MIPS_SP_REGNUM),
-	    get_frame_pc (this_frame));
-}
-
 /* Implement the "write_pc" gdbarch method.  */
 
 void
@@ -8689,8 +8667,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Unwind the frame.  */
   set_gdbarch_unwind_pc (gdbarch, mips_unwind_pc);
-  set_gdbarch_unwind_sp (gdbarch, mips_unwind_sp);
-  set_gdbarch_dummy_id (gdbarch, mips_dummy_id);
 
   /* Map debug register numbers onto internal register numbers.  */
   set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
-- 
2.14.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]