From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24111 invoked by alias); 27 Oct 2007 09:22:29 -0000 Received: (qmail 24100 invoked by uid 22791); 27 Oct 2007 09:22:28 -0000 X-Spam-Check-By: sourceware.org Received: from heller.inter.net.il (HELO heller.inter.net.il) (213.8.233.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 27 Oct 2007 09:22:25 +0000 Received: from HOME-C4E4A596F7 (IGLD-84-228-136-250.inter.net.il [84.228.136.250]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id DYX21599 (AUTH halo1); Sat, 27 Oct 2007 11:22:09 +0200 (IST) Date: Sat, 27 Oct 2007 12:05:00 -0000 Message-Id: From: Eli Zaretskii To: luisgpm@linux.vnet.ibm.com CC: gdb-patches@sourceware.org In-reply-to: <1193449497.6950.22.camel@localhost> (message from Luis Machado on Fri, 26 Oct 2007 22:44:57 -0300) Subject: Re: [PATCH] printf support for DFP values Reply-to: Eli Zaretskii References: <1193449497.6950.22.camel@localhost> 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-10/txt/msg00740.txt.bz2 > From: Luis Machado > Date: Fri, 26 Oct 2007 22:44:57 -0300 > > GDB's printf command currently does not support printing of DFP values > (Decimal32, Decimal64 and Decimal128). The following patch proposes to > fix that by allowing GDB's printf command to deal with those numbers. Thanks. > Native DFP printing support with printf is not yet ready, but it should > be in some time eventually. Due to this, i'm testing for native printf > support for DFP in the configure script and setting a constant to > reflect the result (PRINTF_HAS_DECFLOAT). Based on that GDB has two ways > of dealing with the problem: > > 1 - If we have native support (and thus PRINTF_HAS_DECFLOAT is set), we > just send the DFP value straight to the standard printing routine with > its format specifiers (printf_filtered). > > 2 - If there's currently no support, we stick with converting the DFP > values to strings and using string format specifiers to print them. This > should make things flexible enough for both systems, one that has native > printf support for DFP and one that doesn't. > > I'd appreciate comments on this one. If we can implement DFP printing in GDB, why should we also check for native DFP support and use that if available? Are there any advantages in the native DFP printing, and if so, what are they? Also, if this patch is accepted, please submit also a suitable patch for the manual (doc/gdb.texinfo), where we describe the format conversions supported by the `printf' command (node "Output"). A few questions/comments to the patch itself: > - double_arg, long_double_arg > + double_arg, long_double_arg, decfloat_arg You are using decfloat_arg unconditionally, but I don't see it defined anywhere in today's CVS. Am I missing something? > + /* Replace %H, %D and %DD for %s's. */ Did you mean "Replace ... _with_ %s's"?