[committed] store sp in alpha_push_dummy_call
Richard Henderson
rth@twiddle.net
Sun Jun 1 18:13:00 GMT 2003
Apparently, push_dummy_call is expected to update the sp:
/* NOTE: cagney/2003-03-23: Disable this code when there is a
push_dummy_call() method. Since that method will have already
stored the stack pointer (as part of creating the fake call
frame), and none of the code following that code adjusts the
stack-pointer value, the below call is entirely redundant. */
if (DEPRECATED_DUMMY_WRITE_SP_P ())
DEPRECATED_DUMMY_WRITE_SP (sp);
Andrew, you have the same problem in your mips push_dummy_call
routines, from which I was pattern matching.
r~
* alpha-tdep.c (alpha_push_dummy_call): Store sp. Tidy copies
from arg_reg_buffer to regcache to avoid double conversion.
Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.89
diff -c -p -d -r1.89 alpha-tdep.c
*** alpha-tdep.c 1 Jun 2003 16:02:50 -0000 1.89
--- alpha-tdep.c 1 Jun 2003 17:00:25 -0000
*************** alpha_push_dummy_call (struct gdbarch *g
*** 314,326 ****
/* Load the argument registers. */
for (i = 0; i < required_arg_regs; i++)
{
! LONGEST val;
!
! val = extract_unsigned_integer (arg_reg_buffer + i*ALPHA_REGISTER_SIZE,
! ALPHA_REGISTER_SIZE);
! regcache_cooked_write_signed (regcache, ALPHA_A0_REGNUM + i, val);
! regcache_cooked_write_signed (regcache, ALPHA_FPA0_REGNUM + i, val);
}
return sp;
}
--- 314,327 ----
/* Load the argument registers. */
for (i = 0; i < required_arg_regs; i++)
{
! regcache_cooked_write (regcache, ALPHA_A0_REGNUM + i,
! arg_reg_buffer + i*ALPHA_REGISTER_SIZE);
! regcache_cooked_write (regcache, ALPHA_FPA0_REGNUM + i,
! arg_reg_buffer + i*ALPHA_REGISTER_SIZE);
}
+
+ /* Finally, update the stack pointer. */
+ regcache_cooked_write_signed (regcache, ALPHA_SP_REGNUM, sp);
return sp;
}
More information about the Gdb-patches
mailing list