diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-02-04 18:33:04 +0100 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-02-04 18:36:47 +0100 |
commit | 5b757e5ddbd9ad252d9c51103f1aa52b41c2e947 (patch) | |
tree | cf476a9f3b17b44d7f8dbf8d01ba405055971daa /gdb/ppc-sysv-tdep.c | |
parent | 084ee54552f6c35d740e8b9bc81a4fe8d8bb178b (diff) | |
download | gdb-5b757e5ddbd9ad252d9c51103f1aa52b41c2e947.zip gdb-5b757e5ddbd9ad252d9c51103f1aa52b41c2e947.tar.gz gdb-5b757e5ddbd9ad252d9c51103f1aa52b41c2e947.tar.bz2 |
PowerPC64 little-endian fixes: 32-bit DFP parameters
Passing a 32-bit DFP in register needs to use the least-significant part
of the register. Like with a previous patch that addressed the same
issue for small structs, this patch makes sure the appropriate offset
is used on little-endian systems.
gdb/ChangeLog:
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct
offset on little-endian when passing _Decimal32.
(ppc64_sysv_abi_return_value_base): Likewise for return values.
Diffstat (limited to 'gdb/ppc-sysv-tdep.c')
-rw-r--r-- | gdb/ppc-sysv-tdep.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 62e9cbd..de5a663 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -1232,7 +1232,10 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, if (argpos->regcache && argpos->freg <= 13) { int regnum = tdep->ppc_fp0_regnum + argpos->freg; - int offset = 8 - TYPE_LENGTH (type); + int offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (type); regcache_cooked_write_part (argpos->regcache, regnum, offset, TYPE_LENGTH (type), val); @@ -1641,7 +1644,10 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) { int regnum = tdep->ppc_fp0_regnum + 1 + index; - int offset = 8 - TYPE_LENGTH (valtype); + int offset = 0; + + if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) + offset = 8 - TYPE_LENGTH (valtype); if (writebuf != NULL) regcache_cooked_write_part (regcache, regnum, |