From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10759 invoked by alias); 18 Sep 2003 22:59:41 -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 10749 invoked from network); 18 Sep 2003 22:59:40 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 18 Sep 2003 22:59:40 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6A3952B89; Thu, 18 Sep 2003 18:59:37 -0400 (EDT) Message-ID: <3F6A38D9.6050603@redhat.com> Date: Thu, 18 Sep 2003 22:59:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [libiberty and gdb] floatformat_is_valid References: <20030915143933.GA22129@nevyn.them.org> <20030918203059.GA21339@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-09/txt/msg00408.txt.bz2 > On Mon, Sep 15, 2003 at 10:39:33AM -0400, Daniel Jacobowitz wrote: > >> GDB's "struct value" has a union in it. This union, named "aligner", has a >> long double member as well as several others; its goal is to be a cheap way >> to ensure that we can load all sorts of values straight from the value >> structure, without alignment problems. Unfortunately, this means that when >> debugging GDB we tend to feed random bytes to printf ("%.35Lg"). That's not >> kosher, and on i386 I've found a whole bunch of numbers which can crash it - >> the gist is that GMP shifts normalized numbers over until it hits a one bit, >> and if the explicit integer bit isn't set it walks right out of the number. >> >> This could show up in other places too. Anywhere you print floating-point >> data from the inferior, really. >> >> So here's a patch which checks for the problem. I added >> floatformat_is_valid to libiberty/floatformat.c. Is this OK? >> [Do I need approval? Floatformat.c is in libiberty, but marked as part of >> GDB.] >> >> Oh, this patch misses some copyright year updates. I'll get them before >> checking in. > > > This patch fixes a really annoyin problem when debugging GDB. It > doesn't generally come up debugging anything else, though. For the record, I don't care :-) It appears to work (I guess my revision should go in?), and fixes a bug. > I'm planning to leave the patch for 6.0.1. Does anyone believe it > should be in 6.0 instead? enjoy, Andrew