mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 03:41:58 +08:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user