Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: Jeff Johnston <jjohnstn@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFC]: remove inconsistency in printcmd.c: print_scalar_formatted
Date: Fri, 12 Dec 2003 23:05:00 -0000	[thread overview]
Message-ID: <20031212230549.GA27967@nevyn.them.org> (raw)
In-Reply-To: <1031212221704.ZM22539@localhost.localdomain>

On Fri, Dec 12, 2003 at 03:17:04PM -0700, Kevin Buettner wrote:
> Something that I've wanted from time to time is a way to print the
> bits comprising a value as some other type.  E.g, if I have a float,
> I'd like to be be able to print the bits that comprise the float as an
> int (or vice versa).  At first, I thought that was the intent of
> print_scalar_formatted(), but I see now that it's not.  If the value
> is stored in memory, you can do it with the appropriate cast, e.g,
> if ``val'' is of type float, you can do ``print *(int *)&val'', but
> AFAIK, you can't do this for values stored in registers or convenience
> variables.  If we had such a mechanism, then I think we'd need some
> code similar to the chunk that you're deleting.

Personally, I've always thought that this is a more natural
interpretation of print/x on a floating point value.  Yes, I realize
it's not what GDB has ever done - I don't know what other people think
about this, or whether it would be a useful change, but since we only
support printing floating point numbers in base 10 it seems more useful
to dump the bit pattern rather than round to nearest integer.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-12-12 23:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-12 20:36 Jeff Johnston
2003-12-12 22:17 ` Kevin Buettner
2003-12-12 23:05   ` Daniel Jacobowitz [this message]
2003-12-13  0:55   ` J. Johnston
2004-01-19 22:23     ` J. Johnston
2004-01-19 22:57       ` Andrew Cagney
2004-01-19 23:18         ` Daniel Jacobowitz
2004-01-19 23:27           ` Kevin Buettner
2004-01-20  0:41           ` Andrew Cagney
2004-01-20  1:22             ` Daniel Jacobowitz
     [not found]               ` <400C8CC0.3040706@gnu.org>
2004-01-20  5:48                 ` Daniel Jacobowitz
2004-01-20  6:55                   ` Eli Zaretskii
2004-01-20 14:52                     ` Daniel Jacobowitz
2004-01-20 19:15                       ` Eli Zaretskii
2004-01-20 19:33                         ` Daniel Jacobowitz
2004-01-20 20:32                           ` Eli Zaretskii
2004-01-20 16:50                     ` Andrew Cagney
2004-01-20 19:10                       ` Eli Zaretskii
2004-01-20 21:29                   ` Andrew Cagney
2004-02-19 22:53                     ` Jeff Johnston

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=20031212230549.GA27967@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@redhat.com \
    --cc=kevinb@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