[03/12] gdb/arc: Use default gdbarch method default_dummy_id.

Message ID 1fdb800b4cab0ecca44932214d3a6b605514e57b.1545918069.git.andrew.burgess@embecosm.com
State New, archived
Headers

Commit Message

Andrew Burgess Dec. 27, 2018, 2:08 p.m. UTC
  Make use of the default gdbarch method for gdbarch_dummy_id.

I have not tested this change but, by inspecting the code, I believe
the default methods are equivalent to the code being deleted.

The arc target supplies its own gdbarch_unwind_pc method that includes
custom debug output, in all other respects the arc method is the same
as default_unwind_pc, however I have left the arc method in place so
that the debug can remain.

gdb/ChangeLog:

	* gdb/arc-tdep.c (arc_dummy_id): Delete.
	(arc_gdbarch_init): Don't register deleted function with
	gdbarch.
---
 gdb/ChangeLog  |  6 ++++++
 gdb/arc-tdep.c | 14 --------------
 2 files changed, 6 insertions(+), 14 deletions(-)
  

Comments

Anton Kolesov Dec. 28, 2018, 12:26 p.m. UTC | #1
> -----Original Message-----
> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Sent: Thursday, December 27, 2018 17:08
> To: gdb-patches@sourceware.org; Anton.Kolesov@synopsys.com
> Cc: alan.hayward@arm.com; abidh@codesourcery.com; hp@axis.com;
> jamesb@excamera.com; vapier@gentoo.org; Andrew Burgess
> <andrew.burgess@embecosm.com>
> Subject: [PATCH 03/12] gdb/arc: Use default gdbarch method
> default_dummy_id.
> 
> Make use of the default gdbarch method for gdbarch_dummy_id.
> 
> I have not tested this change but, by inspecting the code, I believe the default
> methods are equivalent to the code being deleted.
> 
> The arc target supplies its own gdbarch_unwind_pc method that includes
> custom debug output, in all other respects the arc method is the same as
> default_unwind_pc, however I have left the arc method in place so that the
> debug can remain.

Hi Andrew,

LGTM. FWIW, I think custom unwind_pc could be removed as well, if it only
adds extra logging and nothing else.

Anton
  

Patch

diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index c3c78395201..454f69fd3e4 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -509,19 +509,6 @@  arc_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
   *offset_ptr = 0;
 }
 
-/* Implement the "dummy_id" gdbarch method.
-
-   Tear down a dummy frame created by arc_push_dummy_call ().  This data has
-   to be constructed manually from the data in our hand.  The stack pointer
-   and program counter can be obtained from the frame info.  */
-
-static struct frame_id
-arc_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  return frame_id_build (get_frame_sp (this_frame),
-			 get_frame_pc (this_frame));
-}
-
 /* Implement the "push_dummy_call" gdbarch method.
 
    Stack Frame Layout
@@ -2015,7 +2002,6 @@  arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_ps_regnum (gdbarch, ARC_STATUS32_REGNUM);
   set_gdbarch_fp0_regnum (gdbarch, -1);	/* No FPU registers.  */
 
-  set_gdbarch_dummy_id (gdbarch, arc_dummy_id);
   set_gdbarch_push_dummy_call (gdbarch, arc_push_dummy_call);
   set_gdbarch_push_dummy_code (gdbarch, arc_push_dummy_code);