From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9074 invoked by alias); 17 Oct 2006 13:24:36 -0000 Received: (qmail 9064 invoked by uid 22791); 17 Oct 2006 13:24:35 -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; Tue, 17 Oct 2006 13:24:29 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GZovi-0007QM-8Q; Tue, 17 Oct 2006 09:24:26 -0400 Date: Tue, 17 Oct 2006 13:24:00 -0000 From: Daniel Jacobowitz To: Andrew STUBBS Cc: GDB List Subject: Re: GDB printf command Message-ID: <20061017132426.GA28323@nevyn.them.org> Mail-Followup-To: Andrew STUBBS , GDB List References: <4534C695.2050206@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4534C695.2050206@st.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00122.txt.bz2 On Tue, Oct 17, 2006 at 01:03:33PM +0100, Andrew STUBBS wrote: > Hi, > > The %ll issue, recently discussed on the patches list, was originally > reported to me against GDB 6.4. > > While testing my fix to GDB 6.5 I have discovered that the new version > is even more broken than the old one (at least in some respects, no > doubt whatever it set out to fix was achieved). Correct. It was deliberately made stricter, because the older version could crash or internal error in more ways. > Specifically '%lf' is not permitted. This used to work and is permitted > by both C90 and C99. I don't remember what reference I used, but in C99 I see that this is deliberately ignored and the same as %f. Seems dumb to me, but there you go. > Can anybody tell me why this is the case - it seems deliberate - and > what is the intended range of capabilities of this command? > > It would appear to me to be most useful if it can operate on any type > the GDB expression parser is capable of handling, regardless of host system. It seems to me, as I wrote earlier, that the right thing to do would be to change it to work on target types rather than host types. It also seems to me that the right way to do this would be to reuse the printf format string parser from gnulib. We will have to map target types on to host types to get that to work, which will be a little hokey, but it should be doable for all interesting cases. -- Daniel Jacobowitz CodeSourcery