This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 05/11] Little-endian fixes: 32-bit DFP parameters
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 29 Jan 2014 08:34:43 +0400
- Subject: Re: [PATCH 05/11] Little-endian fixes: 32-bit DFP parameters
- Authentication-results: sourceware.org; auth=none
- References: <201401281728 dot s0SHS3jV018883 at d06av02 dot portsmouth dot uk dot ibm dot com>
> 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.
>
> Tested on powerpc64-linux and powerpc64le-linux.
Missing ChangeLog :-).
> Index: binutils-gdb/gdb/ppc-sysv-tdep.c
> ===================================================================
> --- binutils-gdb.orig/gdb/ppc-sysv-tdep.c
> +++ binutils-gdb/gdb/ppc-sysv-tdep.c
> @@ -1231,7 +1231,9 @@ ppc64_sysv_abi_push_freg (struct 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);
Empty line after local variable declaration.
>
> regcache_cooked_write_part (argpos->regcache, regnum,
> offset, TYPE_LENGTH (type), val);
> @@ -1634,7 +1636,9 @@ ppc64_sysv_abi_return_value_base (struct
> && 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);
Likewise.
--
Joel