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: [PATCH, RFA]: Revamp NaN detection & discussion


On Jan 25, 10:03pm, Mark Kettenis wrote:

> I also have an itch about floatformat.{ch} and its functions.  I'd
> rather put all floatformat_* functions in there rather than in
> defs.h/utils.c.  But since it's part of libiberty that's a bit of a
> pain.  Is this stuff really used anywhere outside GDB?  If not,
> perhaps we could claim it back. > Otherwise I'd like to add a
> gdb_floatformat.{ch} and put all the floatformat stuff there.

To the best of my knowledge, the differences between the libiberty
floatformat support and that in GDB is that GDB converts to/from a
DOUBLEST whereas libiberty uses a double.  Also, GDB has fixed some
bugs that are still in the libiberty version.  The opposite may also
be true.

Clearly, it'd be best if only one version of the floatformat
functionality needed to be supported.  Ideally, the floatformat
functionality would reside in libiberty (or perhaps some other
library) and GDB would just make use of it.  It would then be
available for other programs to use as well.  (And indeed, I imagine
these were the original motives which caused this support to
be moved from GDB to libiberty.)  However, as shown by your patch,
GDB would like to extend the functionality from time to time in ways
that may break the other (perhaps mythical) applications which use it. 
So it would seem that GDB will need its own copy of this code.

I don't know if an immediate "claiming back" of the floatformat
support from libiberty is a realistic alternative.  While I don't know
of any other applications which use it, I haven't really looked around
either.  In any event, it seems to me that it would be really
difficult to know whether someone is using this functionality or not.

I think the best thing to do (which comes pretty close to "claiming it
back") is to stop using any of the libiberty floatformat support in
GDB.  In other words, GDB's floatformat support should be entirely
self contained.  (I like your idea of putting it in
gdb_floatformat.[hc].)  Once this is done, the libiberty maintainer
will have the freedom to slowly phase out the floatformat support
if that is deemed a desirable goal.

Kevin

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