This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [rfc/patch] extract/store typed floating ()


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


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