This is the mail archive of the gdb-patches@sources.redhat.com 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/rfc] Deprecate CALL_DUMMY_ADDRESS


The only thing left using it is SPARC and even there the current SPARC overhaul will eventually see it eliminated.

I'll commit this in a few days,
Andrew
2003-08-28  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (DEPRECATED_CALL_DUMMY_ADDRESS): Rename
	CALL_DUMMY_ADDRESS, change to a predicate.
	* gdbarch.h, gdbarch.c: Re-generate.
	* blockframe.c (deprecated_pc_in_call_dummy_at_entry_point):
	Use either DEPRECATED_CALL_DUMMY_ADDRESS or entry_point_address.
	* infcall.c (call_function_by_hand): Ditto.
	* sparc-tdep.c (sparc_push_return_address): Ditto.
	(sparc_gdbarch_init): Set deprecated_call_dummy_address.
	* xstormy16-tdep.c (xstormy16_push_return_address): Replace
	CALL_DUMMY_ADDRESS with entry_point_address.
	* v850-tdep.c (v850_push_return_address): Ditto.
	* sh-tdep.c (sh64_push_return_address): Ditto.
	* s390-tdep.c (s390_push_return_address): Ditto.
	* rs6000-tdep.c (ppc_push_return_address): Ditto.
	* mn10300-tdep.c (mn10300_push_return_address): Ditto.
	* mcore-tdep.c (mcore_push_return_address): Ditto.
	* frv-tdep.c (frv_push_return_address): Ditto.
	* cris-tdep.c (cris_push_return_address): Ditto.
	* arm-tdep.c (arm_push_return_address): Ditto.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.144
diff -u -r1.144 arm-tdep.c
--- arm-tdep.c	24 Aug 2003 11:47:17 -0000	1.144
+++ arm-tdep.c	28 Aug 2003 22:13:25 -0000
@@ -1175,7 +1175,7 @@
 static CORE_ADDR
 arm_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
-  write_register (ARM_LR_REGNUM, CALL_DUMMY_ADDRESS ());
+  write_register (ARM_LR_REGNUM, entry_point_address ());
   return sp;
 }
 
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.77
diff -u -r1.77 blockframe.c
--- blockframe.c	7 Aug 2003 23:41:57 -0000	1.77
+++ blockframe.c	28 Aug 2003 22:13:27 -0000
@@ -570,8 +570,10 @@
 deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp,
 					    CORE_ADDR frame_address)
 {
-  return ((pc) >= CALL_DUMMY_ADDRESS ()
-	  && (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK));
+  CORE_ADDR addr = entry_point_address ();
+  if (DEPRECATED_CALL_DUMMY_ADDRESS_P ())
+    addr = DEPRECATED_CALL_DUMMY_ADDRESS ();
+  return ((pc) >= addr && (pc) <= (addr + DECR_PC_AFTER_BREAK));
 }
 
 /* Returns true for a user frame or a call_function_by_hand dummy
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.80
diff -u -r1.80 cris-tdep.c
--- cris-tdep.c	28 Aug 2003 03:03:44 -0000	1.80
+++ cris-tdep.c	28 Aug 2003 22:13:44 -0000
@@ -1490,7 +1490,7 @@
 static CORE_ADDR
 cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
-  write_register (SRP_REGNUM, CALL_DUMMY_ADDRESS ());
+  write_register (SRP_REGNUM, entry_point_address ());
   return sp;
 }
 
Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.49
diff -u -r1.49 frv-tdep.c
--- frv-tdep.c	28 Aug 2003 03:03:44 -0000	1.49
+++ frv-tdep.c	28 Aug 2003 22:13:52 -0000
@@ -898,7 +898,7 @@
 static CORE_ADDR
 frv_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
-  write_register (lr_regnum, CALL_DUMMY_ADDRESS ());
+  write_register (lr_regnum, entry_point_address ());
   return sp;
 }
 
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.263
diff -u -r1.263 gdbarch.sh
--- gdbarch.sh	18 Aug 2003 20:04:55 -0000	1.263
+++ gdbarch.sh	28 Aug 2003 22:14:37 -0000
@@ -526,7 +526,7 @@
 # DEPRECATED_REGISTER_SIZE can be deleted.
 v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
 v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
-f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0
+F::DEPRECATED_CALL_DUMMY_ADDRESS:CORE_ADDR:deprecated_call_dummy_address:void
 # DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted.
 v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset
 # DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted.
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.24
diff -u -r1.24 infcall.c
--- infcall.c	28 Aug 2003 02:53:08 -0000	1.24
+++ infcall.c	28 Aug 2003 22:14:47 -0000
@@ -557,7 +557,10 @@
 				     value_type, using_gcc);
 	}
       real_pc = funaddr;
-      dummy_addr = CALL_DUMMY_ADDRESS ();
+      dummy_addr = entry_point_address ();
+      if (DEPRECATED_CALL_DUMMY_ADDRESS_P ())
+	/* Override it.  */
+	dummy_addr = DEPRECATED_CALL_DUMMY_ADDRESS ();
       /* Make certain that the address points at real code, and not a
          function descriptor.  */
       dummy_addr = CONVERT_FROM_FUNC_PTR_ADDR (dummy_addr);
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.72
diff -u -r1.72 mcore-tdep.c
--- mcore-tdep.c	28 Aug 2003 03:03:44 -0000	1.72
+++ mcore-tdep.c	28 Aug 2003 22:15:09 -0000
@@ -908,14 +908,14 @@
   return sp;
 }
 
-/* Store the return address for the call dummy. For MCore, we've
-   opted to use generic call dummies, so we simply store the
-   CALL_DUMMY_ADDRESS into the PR register (r15). */
+/* Store the return address for the call dummy. For MCore, we've opted
+   to use generic call dummies, so we simply store the entry-point
+   address into the PR register (r15). */
 
 static CORE_ADDR
 mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
-  write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ());
+  write_register (PR_REGNUM, entry_point_address ());
   return sp;
 }
 
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.85
diff -u -r1.85 mn10300-tdep.c
--- mn10300-tdep.c	28 Aug 2003 03:03:44 -0000	1.85
+++ mn10300-tdep.c	28 Aug 2003 22:15:21 -0000
@@ -862,7 +862,7 @@
 {
   unsigned char buf[4];
 
-  store_unsigned_integer (buf, 4, CALL_DUMMY_ADDRESS ());
+  store_unsigned_integer (buf, 4, entry_point_address ());
   write_memory (sp - 4, buf, 4);
   return sp - 4;
 }
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.148
diff -u -r1.148 rs6000-tdep.c
--- rs6000-tdep.c	18 Aug 2003 20:04:55 -0000	1.148
+++ rs6000-tdep.c	28 Aug 2003 22:15:44 -0000
@@ -1323,7 +1323,7 @@
 ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
   write_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum,
-		  CALL_DUMMY_ADDRESS ());
+		  entry_point_address ());
   return sp;
 }
 
Index: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.110
diff -u -r1.110 s390-tdep.c
--- s390-tdep.c	28 Aug 2003 03:39:20 -0000	1.110
+++ s390-tdep.c	28 Aug 2003 22:15:57 -0000
@@ -2536,7 +2536,7 @@
 static CORE_ADDR
 s390_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
-  write_register (S390_RETADDR_REGNUM, CALL_DUMMY_ADDRESS ());
+  write_register (S390_RETADDR_REGNUM, entry_point_address ());
   return sp;
 }
 
Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.136
diff -u -r1.136 sh-tdep.c
--- sh-tdep.c	21 Aug 2003 00:01:31 -0000	1.136
+++ sh-tdep.c	28 Aug 2003 22:16:16 -0000
@@ -2493,7 +2493,7 @@
 sh64_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
   write_register (gdbarch_tdep (current_gdbarch)->PR_REGNUM,
-		  CALL_DUMMY_ADDRESS ());
+		  entry_point_address ());
   return sp;
 }
 
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.120
diff -u -r1.120 sparc-tdep.c
--- sparc-tdep.c	28 Aug 2003 03:03:44 -0000	1.120
+++ sparc-tdep.c	28 Aug 2003 22:16:45 -0000
@@ -2967,8 +2967,10 @@
 	 This address will actually be the program's entry point.  
 	 There will be a special call_dummy breakpoint there.  */
 
-      write_register (O7_REGNUM, 
-		      CALL_DUMMY_ADDRESS () - 8);
+      if (DEPRECATED_CALL_DUMMY_ADDRESS_P ())
+	write_register (O7_REGNUM, DEPRECATED_CALL_DUMMY_ADDRESS () - 8);
+      else
+	write_register (O7_REGNUM, entry_point_address () - 8);
     }
 
   return sp;
@@ -3136,7 +3138,8 @@
     sparc_fix_call_dummy (dummy, pc, fun, type, gcc_p);
 }
 
-/* CALL_DUMMY_ADDRESS: fetch the breakpoint address for a call dummy.  */
+/* DEPRECATED_CALL_DUMMY_ADDRESS: fetch the breakpoint address for a
+   call dummy.  */
 
 static CORE_ADDR
 sparc_call_dummy_address (void)
@@ -3314,7 +3317,7 @@
 
 #ifdef SPARC32_CALL_DUMMY_ON_STACK
       set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
-      set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
+      set_gdbarch_deprecated_call_dummy_address (gdbarch, sparc_call_dummy_address);
       set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 0x30);
       set_gdbarch_deprecated_call_dummy_length (gdbarch, 0x38);
 
@@ -3414,7 +3417,7 @@
 
 #ifdef SPARC64_CALL_DUMMY_ON_STACK
       set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
-      set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
+      set_gdbarch_deprecated_call_dummy_address (gdbarch, sparc_call_dummy_address);
       set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
       set_gdbarch_deprecated_call_dummy_length (gdbarch, 192);
       set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.69
diff -u -r1.69 v850-tdep.c
--- v850-tdep.c	28 Aug 2003 03:03:44 -0000	1.69
+++ v850-tdep.c	28 Aug 2003 22:16:51 -0000
@@ -1000,7 +1000,7 @@
 static CORE_ADDR
 v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
-  write_register (E_RP_REGNUM, CALL_DUMMY_ADDRESS ());
+  write_register (E_RP_REGNUM, entry_point_address ());
   return sp;
 }
 
Index: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.59
diff -u -r1.59 xstormy16-tdep.c
--- xstormy16-tdep.c	28 Aug 2003 03:03:44 -0000	1.59
+++ xstormy16-tdep.c	28 Aug 2003 22:16:55 -0000
@@ -312,7 +312,7 @@
 {
   unsigned char buf[xstormy16_pc_size];
 
-  store_unsigned_integer (buf, xstormy16_pc_size, CALL_DUMMY_ADDRESS ());
+  store_unsigned_integer (buf, xstormy16_pc_size, entry_point_address ());
   write_memory (sp, buf, xstormy16_pc_size);
   return sp + xstormy16_pc_size;
 }

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