From: Mark Kettenis Date: Mon, 17 May 2004 22:12:13 +0000 (+0000) Subject: * vax-tdep.c (vax_return_value): Implement X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e548314585c24fbfcc636095a972cea825673c62;p=binutils-gdb.git * vax-tdep.c (vax_return_value): Implement RETURN_VALUE_ABI_RETURNS_ADDRESS. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 27d005854da..a3efd1e850c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-05-18 Mark Kettenis + + * vax-tdep.c (vax_return_value): Implement + RETURN_VALUE_ABI_RETURNS_ADDRESS. + 2004-05-17 Mark Kettenis * vax-tdep.c (vax_return_value): Fix typo. diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index f9f044a45aa..e5b7cb8b683 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -212,7 +212,21 @@ vax_return_value (struct gdbarch *gdbarch, struct type *type, if (TYPE_CODE (type) == TYPE_CODE_STRUCT || TYPE_CODE (type) == TYPE_CODE_UNION || TYPE_CODE (type) == TYPE_CODE_ARRAY) - return RETURN_VALUE_STRUCT_CONVENTION; + { + /* The default on VAX is to return structures in static memory. + Consequently a function must return the address where we can + find the return value. */ + + if (readbuf) + { + ULONGEST addr; + + regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); + read_memory (addr, readbuf, len); + } + + return RETURN_VALUE_ABI_RETURNS_ADDRESS; + } if (readbuf) {