From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30649 invoked by alias); 1 Jul 2007 16:03:00 -0000 Received: (qmail 30637 invoked by uid 22791); 1 Jul 2007 16:02:59 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 01 Jul 2007 16:02:56 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 24FB3982BB; Sun, 1 Jul 2007 16:02:55 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 03359982B8; Sun, 1 Jul 2007 16:02:55 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1I51sW-0003DD-Uv; Sun, 01 Jul 2007 12:02:24 -0400 Date: Sun, 01 Jul 2007 16:03:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: gdb-patches@sourceware.org, gaius@glam.ac.uk Subject: Re: [RFC] logic change in m2-valprint.c Message-ID: <20070701160224.GH10872@caradoc.them.org> Mail-Followup-To: Michael Snyder , gdb-patches@sourceware.org, gaius@glam.ac.uk References: <16087.12.7.175.2.1183076995.squirrel@webmail.sonic.net> <20070701154831.GE10872@caradoc.them.org> <004a01c7bbf8$16a2ccc0$677ba8c0@sonic.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004a01c7bbf8$16a2ccc0$677ba8c0@sonic.net> User-Agent: Mutt/1.5.15 (2007-04-09) 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-07/txt/msg00013.txt.bz2 On Sun, Jul 01, 2007 at 08:54:19AM -0700, Michael Snyder wrote: > > It can't be backwards; this is trying to print "1" or "1, 2" but your > > change would make it print ", 1" and ", 12". > > > > I think it's also trying to shorten ranges to "{1..3, 6..7}". The > > bug's got to be in there somewhere. Why's the code dead? I'm not > > seeing it... element_seen can be reset by the bit clear case, and then > > we'll get into the test you're changing again. > > 'Cause we're not in a loop, and it's not a static variable. > The code is serial. At entry we set empty_set to one, and > then we test to see if it's zero. It can't be zero. How sure are you sure we're not in a loop? :-) for (i = low_bound; i <= high_bound; i++) { bitval = value_bit_index (TYPE_FIELD_TYPE (type, field), (TYPE_FIELD_BITPOS (type, field) / 8) + valaddr + embedded_offset, i); if (bitval < 0) error (_("bit test is out of range")); else if (bitval > 0) { previous_high = i; if (! element_seen) { if (! empty_set) fprintf_filtered (stream, ", "); -- Daniel Jacobowitz CodeSourcery