From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [libiberty and gdb] floatformat_is_valid
Date: Sun, 21 Sep 2003 19:11:00 -0000 [thread overview]
Message-ID: <20030921191153.GA11900@nevyn.them.org> (raw)
In-Reply-To: <3F6A38D9.6050603@redhat.com>
On Thu, Sep 18, 2003 at 06:59:37PM -0400, Andrew Cagney wrote:
> >On Mon, Sep 15, 2003 at 10:39:33AM -0400, Daniel Jacobowitz wrote:
> >
> >>GDB's "struct value" has a union in it. This union, named "aligner", has
> >>a
> >>long double member as well as several others; its goal is to be a cheap
> >>way
> >>to ensure that we can load all sorts of values straight from the value
> >>structure, without alignment problems. Unfortunately, this means that
> >>when
> >>debugging GDB we tend to feed random bytes to printf ("%.35Lg"). That's
> >>not
> >>kosher, and on i386 I've found a whole bunch of numbers which can crash
> >>it -
> >>the gist is that GMP shifts normalized numbers over until it hits a one
> >>bit,
> >>and if the explicit integer bit isn't set it walks right out of the
> >>number.
> >>
> >>This could show up in other places too. Anywhere you print floating-point
> >>data from the inferior, really.
> >>
> >>So here's a patch which checks for the problem. I added
> >>floatformat_is_valid to libiberty/floatformat.c. Is this OK?
> >>[Do I need approval? Floatformat.c is in libiberty, but marked as part of
> >>GDB.]
> >>
> >>Oh, this patch misses some copyright year updates. I'll get them before
> >>checking in.
> >
> >
> >This patch fixes a really annoyin problem when debugging GDB. It
> >doesn't generally come up debugging anything else, though.
>
> For the record, I don't care :-) It appears to work (I guess my
> revision should go in?), and fixes a bug.
I asked myself, "Dan, are you going to add this patch to all your GDB
packages anyway?" The answer was yes, so I'm checking it in.
+2003-09-19 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from mainline:
+ 2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * values.c (unpack_double): Call floatformat_is_valid.
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.h (floatformat_to_double): Make input buffer constant.
+ (floatformat_from_double, floatformat_is_valid): Ditto.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * floatformat.h (floatformat_is_valid): Add prototype.
+
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.c (get_field): Make "data" constant.
+ (floatformat_is_valid, floatformat_to_double): Make "from"
+ constant, fix casts.
+ (floatformat_from_double): Make "from" constant.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * floatformat.c (floatformat_is_valid): New function.
+ (get_field, put_field): Correct comments.
+
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
prev parent reply other threads:[~2003-09-21 19:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-15 14:39 Daniel Jacobowitz
2003-09-15 17:57 ` DJ Delorie
2003-09-15 20:33 ` Daniel Jacobowitz
2003-09-15 20:54 ` Andrew Cagney
2003-09-15 20:58 ` Daniel Jacobowitz
2003-09-15 21:04 ` Andrew Cagney
2003-09-15 21:48 ` DJ Delorie
2003-09-16 2:57 ` Andrew Cagney
2003-09-16 3:10 ` DJ Delorie
2003-09-22 17:43 ` Andrew Cagney
2003-09-15 21:22 ` Andrew Cagney
2003-09-15 21:52 ` Mark Kettenis
2003-09-18 20:31 ` Daniel Jacobowitz
2003-09-18 22:59 ` Andrew Cagney
2003-09-21 19:11 ` Daniel Jacobowitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030921191153.GA11900@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox