aboutsummaryrefslogtreecommitdiff
path: root/gdb/spu-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-03 21:27:05 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-03 21:27:05 +0000
commit9ff3afda84c2aa2d6fe70b91a5fd9def10e15228 (patch)
tree5b189246875b92fc9ea41c9c0e1ea3fbf5b44cc7 /gdb/spu-tdep.c
parentc4891da7f9acc20edcc7b8ba551c44efd79b199c (diff)
downloadgdb-9ff3afda84c2aa2d6fe70b91a5fd9def10e15228.zip
gdb-9ff3afda84c2aa2d6fe70b91a5fd9def10e15228.tar.gz
gdb-9ff3afda84c2aa2d6fe70b91a5fd9def10e15228.tar.bz2
* spu-tdep.c (spu_push_dummy_call): Update all stack pointer slots
when allocating stack frame for inferior call.
Diffstat (limited to 'gdb/spu-tdep.c')
-rw-r--r--gdb/spu-tdep.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index b016d4b..8ebaf04 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1107,6 +1107,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
+ CORE_ADDR sp_delta;
int i;
int regnum = SPU_ARG1_REGNUM;
int stack_arg = -1;
@@ -1186,8 +1187,14 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
regcache_cooked_read (regcache, SPU_RAW_SP_REGNUM, buf);
target_write_memory (sp, buf, 16);
- /* Finally, update the SP register. */
- regcache_cooked_write_unsigned (regcache, SPU_SP_REGNUM, sp);
+ /* Finally, update all slots of the SP register. */
+ sp_delta = sp - extract_unsigned_integer (buf, 4);
+ for (i = 0; i < 4; i++)
+ {
+ CORE_ADDR sp_slot = extract_unsigned_integer (buf + 4*i, 4);
+ store_unsigned_integer (buf + 4*i, 4, sp_slot + sp_delta);
+ }
+ regcache_cooked_write (regcache, SPU_RAW_SP_REGNUM, buf);
return sp;
}