aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2013-02-06 19:40:04 +0000
committerDavid S. Miller <davem@redhat.com>2013-02-06 19:40:04 +0000
commitbbfdfe1c572ca7710cf08607db4935e8c8db174c (patch)
tree9b17fe788ec840a339b176b8fd82ebe353cef5fe /gdb/sparc-tdep.c
parentbc9abe4a9122ac5984bb05ecd895ddeec6c8a67c (diff)
downloadgdb-bbfdfe1c572ca7710cf08607db4935e8c8db174c.zip
gdb-bbfdfe1c572ca7710cf08607db4935e8c8db174c.tar.gz
gdb-bbfdfe1c572ca7710cf08607db4935e8c8db174c.tar.bz2
Allow struct 'return' on 32-bit sparc.
gdb/ * sparc-tdep.c (sparc32_return_value): Handle writing return value when using RETURN_VALUE_ABI_PRESERVES_ADDRESS. * value.c (struct_return_convention): New function. (using_struct_return): Implement in terms of struct_return_convention. * value.h (struct_return_convention): Declare. * stack.c (return_command): Allow successful overriding of the return value when RETURN_VALUE_ABI_PRESERVES_ADDRESS.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 3ae7395..2b38521 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1370,15 +1370,21 @@ sparc32_return_value (struct gdbarch *gdbarch, struct value *function,
if (sparc_structure_or_union_p (type)
|| (sparc_floating_p (type) && TYPE_LENGTH (type) == 16))
{
+ ULONGEST sp;
+ CORE_ADDR addr;
+
if (readbuf)
{
- ULONGEST sp;
- CORE_ADDR addr;
-
regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
addr = read_memory_unsigned_integer (sp + 64, 4, byte_order);
read_memory (addr, readbuf, TYPE_LENGTH (type));
}
+ if (writebuf)
+ {
+ regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
+ addr = read_memory_unsigned_integer (sp + 64, 4, byte_order);
+ write_memory (addr, writebuf, TYPE_LENGTH (type));
+ }
return RETURN_VALUE_ABI_PRESERVES_ADDRESS;
}