From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2457 invoked by alias); 12 Dec 2003 23:05:51 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2426 invoked from network); 12 Dec 2003 23:05:49 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 12 Dec 2003 23:05:49 -0000 Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian)) id 1AUwM1-0007Hp-6v; Fri, 12 Dec 2003 18:05:49 -0500 Date: Fri, 12 Dec 2003 23:05:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: Jeff Johnston , gdb-patches@sources.redhat.com Subject: Re: [RFC]: remove inconsistency in printcmd.c: print_scalar_formatted Message-ID: <20031212230549.GA27967@nevyn.them.org> Mail-Followup-To: Kevin Buettner , Jeff Johnston , gdb-patches@sources.redhat.com References: <3FDA26B1.6010704@redhat.com> <1031212221704.ZM22539@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1031212221704.ZM22539@localhost.localdomain> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-12/txt/msg00344.txt.bz2 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