OSDN Git Service

2003-09-08 Andrew Cagney <cagney@redhat.com>
authorcagney <cagney>
Tue, 9 Sep 2003 03:58:17 +0000 (03:58 +0000)
committercagney <cagney>
Tue, 9 Sep 2003 03:58:17 +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 f309ba8..1ca28e4 100644 (file)
@@ -1,5 +1,25 @@
 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
        enum.  Add REG_UNSPECIFIED, rename REG_UNSAVED to REG_UNDEFINED
        and REG_UNMODIFIED to REG_SAME_VALUE.
index d54b956..9187207 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 4e689ac..f431b50 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 81a80d8..27ef266 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 b523935..d7c65f4 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 1471378..a15044b 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 9bb9d5c..efb1ef0 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 6baa88a..8820e9c 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 a8381ed..dcb8a93 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 be9bf97..83be4d1 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 6265f90..eaf4db6 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 50aa541..e3c71d4 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 970d953..c516efd 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 2705804..c7a8027 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 f6d8fcc..15abe45 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;
 }