aboutsummaryrefslogtreecommitdiff
path: root/gdb/vax-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-05-17 22:12:13 +0000
committerMark Kettenis <kettenis@gnu.org>2004-05-17 22:12:13 +0000
commite548314585c24fbfcc636095a972cea825673c62 (patch)
tree236d9fcb078b4d5daf8a77b301b7547b7e54f3b9 /gdb/vax-tdep.c
parentcaed1a458002ae270ce2db725510aff5d1c9f2b9 (diff)
downloadgdb-e548314585c24fbfcc636095a972cea825673c62.zip
gdb-e548314585c24fbfcc636095a972cea825673c62.tar.gz
gdb-e548314585c24fbfcc636095a972cea825673c62.tar.bz2
* vax-tdep.c (vax_return_value): Implement
RETURN_VALUE_ABI_RETURNS_ADDRESS.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r--gdb/vax-tdep.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index f9f044a..e5b7cb8 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)
{