This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix printing functions with complex return on PPC64


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]