From 9515395e66db89b143374414b98ef8c3ee233a7b Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 5 Jan 2004 20:38:57 +0000 Subject: [PATCH] * sparc-tdep.c (sparc_extract_struct_value_address): Get the address from [sp + 64] instead of %o2. --- gdb/ChangeLog | 3 +++ gdb/sparc-tdep.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0e5ef29..2c4903e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2004-01-05 Mark Kettenis + * sparc-tdep.c (sparc_extract_struct_value_address): Get the + address from [sp + 64] instead of %o2. + * frame.c (get_prev_frame): Don't try to unwind the PC. This fixes PR backtrace/1476. 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 -- 2.7.4