From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13416 invoked by alias); 27 Aug 2007 15:58:29 -0000 Received: (qmail 13376 invoked by uid 22791); 27 Aug 2007 15:58:27 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 27 Aug 2007 15:58:20 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7RFwIQS015037 for ; Mon, 27 Aug 2007 11:58:18 -0400 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7RFwHWh001972; Mon, 27 Aug 2007 11:58:17 -0400 Received: from newbox.mollernet.net (vpn-14-7.rdu.redhat.com [10.11.14.7]) by lacrosse.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id l7RFwG2X022597; Mon, 27 Aug 2007 11:58:16 -0400 Message-ID: <46D2F498.9000407@redhat.com> Date: Mon, 27 Aug 2007 15:58:00 -0000 From: Chris Moller User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: Andrew Cagney CC: frysk@sourceware.org Subject: Re: -format options References: <46D2F057.7050901@redhat.com> In-Reply-To: <46D2F057.7050901@redhat.com> X-Enigmail-Version: 0.95.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig56B17AF96570838AC4B4AE13" X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00351.txt.bz2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig56B17AF96570838AC4B4AE13 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 1490 Any reason you couldn't just pass a kind of printf format string to -format. E.g., print 1.0 "%g 0x%08x" would print the value first as a double--1.0--and then again in hex.=20 (Unlike printf, each % substitution would refer to the same value.) cm Andrew Cagney wrote: > Hi, > > some questions, and ideas. > > What should the -format qualifier do when applied to floating point?=20 > For instance: > (fhpd) print 1.0 -format x > 0x1 > i.e., convert the cooked value to decimal and then print in hex; or: > (fhpd) print 1.0 -format x > 0x3ff0000000000000 > i.e., print the raw value in hex. I think the answer depends on the > next question. > > What possible format options are there and how should they interact? > Here's a possible list: > bi[t]s, [o]ctal, [d]ecimal, he[x]adecimal, [f]loat, [v]alue (i.e., > default) > [r]aw, [c]ooked > [b]ig-endian, [l]ittle-endian, [n]ative (for default) > [s]igned, [u]nsigned, [i]nteger (for default???) > reset: - > are there others? I've tried to make each set largely orthogonal; > does this work? Would other combinations be better? For > signed/unsigned is there a better "default" to integer. Should > [o][x][t] just imply unsigned? > > How should these options be specified; Either: > -format rx > or > -format x -data r -order b > for dumping each field in big-endian raw hex. I prefer the more terse > former. > --=20 Chris Moller Java: the blunt scissors of programming languages. -- Dave Thomas --------------enig56B17AF96570838AC4B4AE13 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 252 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG0vSYmpMCeQnqFMkRAmVPAJ47pl6COicwQg3VQoLZLQAfJYlySACaAwE4 KMDztNtP0BCnEuzoF5D+vYg= =e14W -----END PGP SIGNATURE----- --------------enig56B17AF96570838AC4B4AE13--