diff options
author | Andrew Cagney <cagney@redhat.com> | 1998-04-01 04:52:37 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1998-04-01 04:52:37 +0000 |
commit | 19735aeaa1575ba240f240391c7c5ba96c576f0c (patch) | |
tree | 8bd1b9cb7a0d6ed34ec3e6551d606abc5ae0215d /gdb/d10v-tdep.c | |
parent | e1fe7a7966c38bc0ed17b7ed3cea5863f0686da2 (diff) | |
download | gdb-19735aeaa1575ba240f240391c7c5ba96c576f0c.zip gdb-19735aeaa1575ba240f240391c7c5ba96c576f0c.tar.gz gdb-19735aeaa1575ba240f240391c7c5ba96c576f0c.tar.bz2 |
* d10v-tdep.c (d10v_extract_return_value): Wierd. GCC wants to return
odd sized register quantities with only half of the first register used!
* config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Use stack when size > 8.
Diffstat (limited to 'gdb/d10v-tdep.c')
-rw-r--r-- | gdb/d10v-tdep.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 6e57891..10d249b 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -654,8 +654,17 @@ d10v_extract_return_value (type, regbuf, valbuf) unsigned short c = extract_unsigned_integer (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM)); store_unsigned_integer (valbuf, 1, c); } - else + else if ((len & 1) == 0) memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM), len); + else + { + /* For return values of odd size, the first byte is in the + least significant part of the first register. The + remaining bytes in remaining registers. Interestingly, + when such values are passed in, the last byte is in the + most significant byte of that same register - wierd. */ + memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM) + 1, len); + } } } |