+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
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;
}
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
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;
}
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;
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 */
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;
/* 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 */
(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",
"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",
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
#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. */
# 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.
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);
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;
}
{
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;
}
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;
}
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;
}
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;
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)
#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);
#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);
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;
}
{
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;
}