aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index ab3f365..92684a3 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -839,10 +839,10 @@ sparc32_return_value (struct gdbarch *gdbarch, struct type *type,
static CORE_ADDR
sparc_extract_struct_value_address (struct regcache *regcache)
{
- ULONGEST addr;
+ ULONGEST sp;
- regcache_cooked_read_unsigned (regcache, SPARC_O0_REGNUM, &addr);
- return addr;
+ regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
+ return read_memory_unsigned_integer (sp + 64, 4);
}
static int