2003-09-08 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Tue, 9 Sep 2003 03:58:18 +0000 (03:58 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 9 Sep 2003 03:58:18 +0000 (03:58 +0000)
* 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.
* 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.
* cris-tdep.c (cris_push_return_address): Ditto.
* arm-tdep.c (arm_push_return_address): Ditto.

15 files changed:
gdb/ChangeLog
gdb/arm-tdep.c
gdb/blockframe.c
gdb/cris-tdep.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/infcall.c
gdb/mcore-tdep.c
gdb/mn10300-tdep.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/sparc-tdep.c
gdb/v850-tdep.c
gdb/xstormy16-tdep.c

index f309ba8541799d68a4b6c41cacb2b6af41a9dbf3..1ca28e4220515078d85113fbf4346e7e9aa7ac17 100644 (file)
@@ -1,3 +1,23 @@
+2003-09-08  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.
+       * 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.
+       * cris-tdep.c (cris_push_return_address): Ditto.
+       * arm-tdep.c (arm_push_return_address): Ditto.
+
 2003-09-08  Andrew Cagney  <cagney@redhat.com>
 
        * dwarf2-frame.c (enum dwarf2_reg_rule): New, replace anonymous
index d54b956a021e8d63a5dad4dab036cfd3aa1e7561..91872072a659e0ce65fb1bd46ae44124ad831c27 100644 (file)
@@ -1178,7 +1178,7 @@ arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
 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 4e689ac644bf4226facef6b108bf1e77681735f9..f431b50a787b91a2bd35d244ca70be09491556c3 100644 (file)
@@ -570,8 +570,10 @@ int
 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 81a80d8be76fd7de96c8ab0ccb5a86a5c69a8630..27ef266cc58d495cbefc57216115f3bc8c8ca10b 100644 (file)
@@ -1490,7 +1490,7 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
 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 b523935e6ceb3eda9bfbb91ce5078e1a470e21c3..d7c65f47ebe9f8f67410d9748c7c9432cb984e2d 100644 (file)
@@ -168,7 +168,7 @@ struct gdbarch
   gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp;
   int deprecated_register_size;
   int call_dummy_location;
-  gdbarch_call_dummy_address_ftype *call_dummy_address;
+  gdbarch_deprecated_call_dummy_address_ftype *deprecated_call_dummy_address;
   CORE_ADDR deprecated_call_dummy_start_offset;
   CORE_ADDR deprecated_call_dummy_breakpoint_offset;
   int deprecated_call_dummy_length;
@@ -336,7 +336,7 @@ struct gdbarch startup_gdbarch =
   0,  /* deprecated_dummy_write_sp */
   0,  /* deprecated_register_size */
   0,  /* call_dummy_location */
-  0,  /* call_dummy_address */
+  0,  /* deprecated_call_dummy_address */
   0,  /* deprecated_call_dummy_start_offset */
   0,  /* deprecated_call_dummy_breakpoint_offset */
   0,  /* deprecated_call_dummy_length */
@@ -513,7 +513,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->deprecated_fp_regnum = -1;
   current_gdbarch->deprecated_use_generic_dummy_frames = 1;
   current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
-  current_gdbarch->call_dummy_address = entry_point_address;
   current_gdbarch->deprecated_call_dummy_words = legacy_call_dummy_words;
   current_gdbarch->deprecated_sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
   current_gdbarch->print_registers_info = default_print_registers_info;
@@ -656,7 +655,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of deprecated_push_return_address, has predicate */
   /* Skip verify of deprecated_dummy_write_sp, has predicate */
   /* Skip verify of call_dummy_location, invalid_p == 0 */
-  /* Skip verify of call_dummy_address, invalid_p == 0 */
+  /* Skip verify of deprecated_call_dummy_address, has predicate */
   /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
   /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
   /* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */
@@ -887,16 +886,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       (long) current_gdbarch->breakpoint_from_pc
                       /*BREAKPOINT_FROM_PC ()*/);
 #endif
-#ifdef CALL_DUMMY_ADDRESS
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "CALL_DUMMY_ADDRESS()",
-                      XSTRING (CALL_DUMMY_ADDRESS ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CALL_DUMMY_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->call_dummy_address
-                      /*CALL_DUMMY_ADDRESS ()*/);
-#endif
 #ifdef CALL_DUMMY_LOCATION
   fprintf_unfiltered (file,
                       "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
@@ -974,6 +963,25 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
                       (long) DECR_PC_AFTER_BREAK);
 #endif
+#ifdef DEPRECATED_CALL_DUMMY_ADDRESS_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_CALL_DUMMY_ADDRESS_P()",
+                      XSTRING (DEPRECATED_CALL_DUMMY_ADDRESS_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_ADDRESS_P() = %d\n",
+                      DEPRECATED_CALL_DUMMY_ADDRESS_P ());
+#endif
+#ifdef DEPRECATED_CALL_DUMMY_ADDRESS
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_CALL_DUMMY_ADDRESS()",
+                      XSTRING (DEPRECATED_CALL_DUMMY_ADDRESS ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_ADDRESS = <0x%08lx>\n",
+                      (long) current_gdbarch->deprecated_call_dummy_address
+                      /*DEPRECATED_CALL_DUMMY_ADDRESS ()*/);
+#endif
 #ifdef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
   fprintf_unfiltered (file,
                       "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
@@ -3501,21 +3509,28 @@ set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
   gdbarch->call_dummy_location = call_dummy_location;
 }
 
+int
+gdbarch_deprecated_call_dummy_address_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->deprecated_call_dummy_address != NULL;
+}
+
 CORE_ADDR
-gdbarch_call_dummy_address (struct gdbarch *gdbarch)
+gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->call_dummy_address != NULL);
+  gdb_assert (gdbarch->deprecated_call_dummy_address != NULL);
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
-  return gdbarch->call_dummy_address ();
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_address called\n");
+  return gdbarch->deprecated_call_dummy_address ();
 }
 
 void
-set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
-                                gdbarch_call_dummy_address_ftype call_dummy_address)
+set_gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch,
+                                           gdbarch_deprecated_call_dummy_address_ftype deprecated_call_dummy_address)
 {
-  gdbarch->call_dummy_address = call_dummy_address;
+  gdbarch->deprecated_call_dummy_address = deprecated_call_dummy_address;
 }
 
 CORE_ADDR
index 1471378b7c58e5448f318b6aa4d64d59af625c46..a15044be4e2cd0b44c015b423059b7724ae4c0ca 100644 (file)
@@ -846,14 +846,29 @@ extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_d
 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
 #endif
 
-typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
-extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
-#error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
-#endif
-#if !defined (CALL_DUMMY_ADDRESS)
-#define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
+#if defined (DEPRECATED_CALL_DUMMY_ADDRESS)
+/* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_ADDRESS */
+#if !defined (DEPRECATED_CALL_DUMMY_ADDRESS_P)
+#define DEPRECATED_CALL_DUMMY_ADDRESS_P() (1)
+#endif
+#endif
+
+extern int gdbarch_deprecated_call_dummy_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_ADDRESS_P)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_ADDRESS_P)
+#define DEPRECATED_CALL_DUMMY_ADDRESS_P() (gdbarch_deprecated_call_dummy_address_p (current_gdbarch))
+#endif
+
+typedef CORE_ADDR (gdbarch_deprecated_call_dummy_address_ftype) (void);
+extern CORE_ADDR gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch, gdbarch_deprecated_call_dummy_address_ftype *deprecated_call_dummy_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_ADDRESS)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_ADDRESS"
+#endif
+#if !defined (DEPRECATED_CALL_DUMMY_ADDRESS)
+#define DEPRECATED_CALL_DUMMY_ADDRESS() (gdbarch_deprecated_call_dummy_address (current_gdbarch))
 #endif
 
 /* DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted. */
index 9bb9d5c971d3ea26fcca52a3c8e6b55013e071d3..efb1ef0234de29946d8b0b0c218538934386f17a 100755 (executable)
@@ -526,7 +526,7 @@ F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val
 # 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 6baa88a337dd133306bd2506fd296c6d68c00ce1..8820e9cec06babf88d7186b19db9108ffe0412bd 100644 (file)
@@ -557,7 +557,10 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
                                     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 a8381ed45b623cbf3e57f8e6b72694cdf81ff1d7..dcb8a93ec74df0508b711425f5fb0de0568d5668 100644 (file)
@@ -908,14 +908,14 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
   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 be9bf975c15e72180201704fb18d297fe2f5173c..83be4d18210fc2f5af8b60ab8d790116b7f00b4a 100644 (file)
@@ -862,7 +862,7 @@ mn10300_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
   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 6265f9032db563b43203481ff67a34f08d9a851a..eaf4db611e42aa22be05b1dfc4ad9ce1150aab96 100644 (file)
@@ -1323,7 +1323,7 @@ static CORE_ADDR
 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 50aa54175ff07034a37e5d9fca28cd5d6ef29b5f..e3c71d4f4479a43f4e9368c474acb69eaa08a888 100644 (file)
@@ -2536,7 +2536,7 @@ s390_addr_bits_remove (CORE_ADDR addr)
 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 970d9536babac9e26df282a32b9a6a91c65de211..c516efd024a451fc7be598916447bd6737b53c95 100644 (file)
@@ -2967,8 +2967,10 @@ sparc_push_return_address (CORE_ADDR pc_unused, CORE_ADDR sp)
         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_gdbarch_fix_call_dummy (char *dummy,
     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 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
 #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 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
 #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 27058045580a84923f7af1ad641edc1ab4722694..c7a8027ad97f242f95573b17a8446e58265e7c1b 100644 (file)
@@ -1000,7 +1000,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
 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 f6d8fcc7ea829a22c355e292ff13807d51feac8f..15abe452f457a2b4f1f5f52a4be4d74c5c02159d 100644 (file)
@@ -312,7 +312,7 @@ xstormy16_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
 {
   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;
 }