This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix printing functions with complex return on PPC64
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tiago StÃrmer Daitx <tdaitx at linux dot vnet dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 26 Nov 2012 10:43:46 +0100
- Subject: Re: [PATCH] Fix printing functions with complex return on PPC64
- References: <50a7b46b.6jsIRrSz9fiMZdfw%tdaitx@linux.vnet.ibm.com>
On Sat, 17 Nov 2012 16:59:39 +0100, Tiago StÃrmer Daitx wrote:
> --- a/gdb/ppc-sysv-tdep.c
> +++ b/gdb/ppc-sysv-tdep.c
> @@ -1925,7 +1925,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
> {
> convert_typed_floating ((const bfd_byte *) writebuf +
> i * (TYPE_LENGTH (valtype) / 2),
> - valtype, regval, regtype);
> + TYPE_TARGET_TYPE (valtype), regval,
> + regtype);
> regcache_cooked_write (regcache,
> tdep->ppc_fp0_regnum + 1 + i,
> regval);
> @@ -1938,7 +1939,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
> convert_typed_floating (regval, regtype,
> (bfd_byte *) readbuf +
> i * (TYPE_LENGTH (valtype) / 2),
> - valtype);
> + TYPE_TARGET_TYPE (valtype));
> }
> }
> }
OK for commit.
You could also replace TYPE_LENGTH (valtype) / 2 there
by TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) to make it more clear
(use some variable for TYPE_TARGET_TYPE (valtype); not required.
Thanks,
Jan