This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfc/patch] extract/store typed floating ()
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: [rfc/patch] extract/store typed floating ()
- From: Mark Kettenis <kettenis at science dot uva dot nl>
- Date: 23 Sep 2001 15:31:30 +0200
- Cc: gdb-patches at sources dot redhat dot com
- References: <3BAA6F4A.1000508@cygnus.com>
Andrew Cagney <ac131313@cygnus.com> writes:
> Hello,
>
> This patch introduces two new functions:
>
> extract_typed_floating()
> store_typed_floating()
>
> The new functions take a ``struct type'' that exactly describes the
> floating point number to be extracted / stored.
The new names sound a lot better than the extract_doublest() you
proposed earlier. I'd say, go for it :-).
> Assuming that there are no concerns raised, I'll check this in in a few
> days.
I'm not sure whether zeroing out the buffer in store_typed_floating()
is desirable. I've (almost) convinced myself that it isn't. Here's a
part of a comment that I added to the doublest.c in my current tree:
/* ...
It is debatable whether we should zero out any remaining
bytes in the target buffer, when converting from a type that
has a smaller length than the target type. Right now we
don't do that. A typical case where this situation arises is
when we convert a i387 floating-point register to a `long
double' in memory. On the target, that operation only stores
the first 10 bytes, and leaves alone the remaining 2 bytes.
It makes sense to mimick this behaviour here. */
This comment comes from a function convert_floating() that I intend to
add to doublest.c. I'll submit a patch after you've checked yours in.
Mark