This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] powerpc - extract a float return value
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Jerome Guitton <guitton at act-europe dot fr>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 21 Apr 2004 10:54:15 -0700
- Subject: Re: [RFA] powerpc - extract a float return value
- Organization: Red Hat
- References: <20040420180348.GA23715@act-europe.fr>
On Tue, 20 Apr 2004 20:03:48 +0200
Jerome Guitton <guitton@act-europe.fr> wrote:
> The way GDB extracts float return values in rs6000-tdep.c
> (rs6000_extract_return_value) seems dubious to me:
>
> [...]
> memcpy (&dd, ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8);
> ff = (float) dd;
> memcpy (valbuf, &ff, sizeof (float));
> [...]
>
> The cast will not work properly if the target and the host have not a similar
> float representation.
I agree.
> I propose to fix that by a call to convert_typed_floating. See patch in
> attachment.
This looks right to me.
The rs6000 return value code will need to be revamped to not refer to
DEPRECATED_REGISTER_BYTE. And, in fact, it probably ought to be
restructured to use the mechanisms found in ppc-linux.c. See
ppc_linux_return_value() and ppc_sysv_abi_return_value(). This
is not a barrier to getting your current patch in; I only mention
it in case you wish to tackle this bit of work too.
> I have not yet tested it against the testsuite, I will do that
> tomorrow. In the meantime, if you have comments I would be happy to
> address them!
Please let me know the results of your tests. If they look good,
please commit your patch.
Thanks!
Kevin