From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16120 invoked by alias); 18 Feb 2007 16:09:08 -0000 Received: (qmail 16111 invoked by uid 22791); 18 Feb 2007 16:09:07 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sun, 18 Feb 2007 16:09:02 +0000 Received: from dsl093-172-095.pit1.dsl.speakeasy.net ([66.93.172.95] helo=caradoc.them.org) by nevyn.them.org with esmtp (Exim 4.63) (envelope-from ) id 1HIoau-0002zD-T9; Sun, 18 Feb 2007 11:08:56 -0500 Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HIoau-0002Lz-37; Sun, 18 Feb 2007 11:08:56 -0500 Date: Sun, 18 Feb 2007 16:09:00 -0000 From: Daniel Jacobowitz To: Andreas Schwab Cc: Jan Kratochvil , gdb-patches@sourceware.org Subject: Re: [RFC] print/x of a float/double should printf ("%a") Message-ID: <20070218160855.GA7414@caradoc.them.org> Mail-Followup-To: Andreas Schwab , Jan Kratochvil , gdb-patches@sourceware.org References: <20070218153705.GA25940@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00224.txt.bz2 On Sun, Feb 18, 2007 at 04:45:57PM +0100, Andreas Schwab wrote: > Jan Kratochvil 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