aboutsummaryrefslogtreecommitdiff
path: root/gdb/config
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1995-04-22 07:30:32 +0000
committerJeff Law <law@redhat.com>1995-04-22 07:30:32 +0000
commit61fe99b477d1573229285d89dc74466b3fb9a0ee (patch)
treebef4ef850d48a7423eb64f90a8c1d3c8a59f4faa /gdb/config
parent1e2bb16402b2183cdc2aba9056f156a8dff2012b (diff)
downloadgdb-61fe99b477d1573229285d89dc74466b3fb9a0ee.zip
gdb-61fe99b477d1573229285d89dc74466b3fb9a0ee.tar.gz
gdb-61fe99b477d1573229285d89dc74466b3fb9a0ee.tar.bz2
* config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Rewrite to correctly
handle "short", "int" and small structures returned in registers.
Diffstat (limited to 'gdb/config')
-rw-r--r--gdb/config/pa/tm-hppa.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index e346f3a..d3ec6cf 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -238,8 +238,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
into VALBUF. */
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy (VALBUF, (REGBUF) + REGISTER_BYTE(TYPE_LENGTH(TYPE) > 4 ? \
- FP4_REGNUM :28), TYPE_LENGTH (TYPE))
+ { \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
+ memcpy ((VALBUF), \
+ ((int *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM), \
+ TYPE_LENGTH (TYPE)); \
+ else \
+ memcpy ((VALBUF), \
+ (char *)(REGBUF) + REGISTER_BYTE (28) + \
+ (TYPE_LENGTH (TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH (TYPE)), \
+ TYPE_LENGTH (TYPE)); \
+ }
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */