Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Andreas Schwab <schwab@suse.de>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFC] print/x of a float/double should printf ("%a")
Date: Sun, 18 Feb 2007 16:09:00 -0000	[thread overview]
Message-ID: <20070218160855.GA7414@caradoc.them.org> (raw)
In-Reply-To: <jeps87bhai.fsf@sykes.suse.de>

On Sun, Feb 18, 2007 at 04:45:57PM +0100, Andreas Schwab wrote:
> Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> 
> > currently "print/x (float) a" does an integer "print/x (long) a".
> >
> > Ulrich Drepper requested to use instead printf ("%a") (man excerpt below):

Can we do this without relying on the system printf?  I was going to
say that it ought to be easy... except it's 500 lines in glibc, so
maybe it isn't.  I suppose we could do it this way and put the glibc
code into gnulib later.

The nasty bit about doing it this way, using the system printf, is
that it potentially loses bits.  For the hex format, which is supposed
to be a precise representation, this could be confusin.

> That makes /x different between print and x.  IMHO this should use a new
> format letter so that it can also be used with x.

Do you really think so?  I actually think this is perfectly
appropriate.  x/d and x/x both format untyped memory, which is
presumed to be an integer.  p/d and p/x should behave the same as x/d
and x/x for integers, but I think hex float is the most sensible thing
for p/x to do (and you can always "p/x {double} $address").  You can't
use this representation with 'x' readily because you may not be able
to specify the type - e.g. you can't use 'x' to display 80-bit
extended.

Of course, we also want a way to show the bits of a register as normal
hex, not hex floating point.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2007-02-18 16:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 15:37 Jan Kratochvil
2007-02-18 15:46 ` Andreas Schwab
2007-02-18 16:09   ` Daniel Jacobowitz [this message]
2007-02-18 16:34     ` Andreas Schwab
2007-02-18 20:26 ` Eli Zaretskii
2007-02-18 20:34   ` Daniel Jacobowitz
2007-02-18 22:32     ` Eli Zaretskii
2007-02-23 16:15   ` Jan Kratochvil
2007-02-23 18:18     ` Eli Zaretskii

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=20070218160855.GA7414@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=schwab@suse.de \
    /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