2003-05-31 Andrew Cagney <cagney@redhat.com>

* gdbarch.sh (PUSH_DUMMY_CALL): Add "func_addr" parameter.  Rename
	"dummy_addr" to "bp_addr".
	* infcall.c (call_function_by_hand): Pass "funaddr" to
	gdbarch_push_dummy_call.
	* gdbarch.h, gdbarch.c: Re-generate.
	* i386-tdep.c (i386_push_dummy_call): Update.
	* arm-tdep.c (arm_push_dummy_call): Update.
	* d10v-tdep.c (d10v_push_dummy_call): Update.
This commit is contained in:
Andrew Cagney 2003-05-31 14:20:31 +00:00
parent c4f35dd8e1
commit 6a65450a7c
8 changed files with 35 additions and 21 deletions

View File

@ -1,3 +1,14 @@
2003-05-31 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (PUSH_DUMMY_CALL): Add "func_addr" parameter. Rename
"dummy_addr" to "bp_addr".
* infcall.c (call_function_by_hand): Pass "funaddr" to
gdbarch_push_dummy_call.
* gdbarch.h, gdbarch.c: Re-generate.
* i386-tdep.c (i386_push_dummy_call): Update.
* arm-tdep.c (arm_push_dummy_call): Update.
* d10v-tdep.c (d10v_push_dummy_call): Update.
2003-05-31 Mark Kettenis <kettenis@gnu.org>
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove

View File

@ -1405,19 +1405,20 @@ pop_stack_item (struct stack_item *si)
we should probably support some of them based on the selected ABI. */
static CORE_ADDR
arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR dummy_addr, int nargs, struct value **args,
CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
arm_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
struct value **args, CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr)
{
int argnum;
int argreg;
int nstack;
struct stack_item *si = NULL;
/* Set the return address. For the ARM, the return breakpoint is always
at DUMMY_ADDR. */
/* Set the return address. For the ARM, the return breakpoint is
always at BP_ADDR. */
/* XXX Fix for Thumb. */
regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, dummy_addr);
regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, bp_addr);
/* Walk through the list of args and determine how large a temporary
stack is required. Need to take care here as structs may be

View File

@ -977,9 +977,10 @@ d10v_push_dummy_code (struct gdbarch *gdbarch,
}
static CORE_ADDR
d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR dummy_addr, int nargs, struct value **args,
CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
d10v_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr)
{
int i;
int regnum = ARG1_REGNUM;
@ -987,9 +988,9 @@ d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
long val;
/* Set the return address. For the d10v, the return breakpoint is
always at DUMMY_ADDR. */
always at BP_ADDR. */
regcache_cooked_write_unsigned (regcache, LR_REGNUM,
d10v_convert_iaddr_to_raw (dummy_addr));
d10v_convert_iaddr_to_raw (bp_addr));
/* If STRUCT_RETURN is true, then the struct return address (in
STRUCT_ADDR) will consume the first argument-passing register.

View File

@ -4264,7 +4264,7 @@ gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
}
CORE_ADDR
gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->push_dummy_call == 0)
@ -4272,7 +4272,7 @@ gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, COR
"gdbarch: gdbarch_push_dummy_call invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
return gdbarch->push_dummy_call (gdbarch, regcache, dummy_addr, nargs, args, sp, struct_return, struct_addr);
return gdbarch->push_dummy_call (gdbarch, func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
}
void

View File

@ -1613,8 +1613,8 @@ extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdba
extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
#if defined (DEPRECATED_PUSH_DUMMY_FRAME)

View File

@ -568,7 +568,7 @@ F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf
f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
# Replaced by PUSH_DUMMY_CALL
F:2:DEPRECATED_PUSH_ARGUMENTS:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr
M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:regcache, dummy_addr, nargs, args, sp, struct_return, struct_addr
M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr
F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0
# NOTE: This can be handled directly in push_dummy_call.
F:2:DEPRECATED_PUSH_RETURN_ADDRESS:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0

View File

@ -1005,9 +1005,10 @@ i386_get_longjmp_target (CORE_ADDR *pc)
static CORE_ADDR
i386_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR dummy_addr, int nargs, struct value **args,
CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
i386_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
struct value **args, CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr)
{
char buf[4];
int i;
@ -1038,7 +1039,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
/* Store return address. */
sp -= 4;
store_unsigned_integer (buf, 4, dummy_addr);
store_unsigned_integer (buf, 4, bp_addr);
write_memory (sp, buf, 4);
/* Finally, update the stack pointer... */

View File

@ -747,7 +747,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
/* When there is no push_dummy_call method, should this code
simply error out. That would the implementation of this method
for all ABIs (which is probably a good thing). */
sp = gdbarch_push_dummy_call (current_gdbarch, current_regcache,
sp = gdbarch_push_dummy_call (current_gdbarch, funaddr, current_regcache,
bp_addr, nargs, args, sp, struct_return,
struct_addr);
else if (DEPRECATED_PUSH_ARGUMENTS_P ())