From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10991 invoked by alias); 24 Aug 2007 15:48:15 -0000 Received: (qmail 10844 invoked by uid 22791); 24 Aug 2007 15:48:14 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Aug 2007 15:48:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7F2182AAF97; Fri, 24 Aug 2007 11:48:02 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IYB5CDlz8YJs; Fri, 24 Aug 2007 11:48:02 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 63F7C2AAF96; Fri, 24 Aug 2007 11:48:02 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7D967E7B58; Fri, 24 Aug 2007 11:52:10 -0400 (EDT) Date: Fri, 24 Aug 2007 15:48:00 -0000 From: Joel Brobecker To: Carlos Eduardo Seo Cc: gdb-patches@sourceware.org Subject: Re: [patch] ptype: show members of an unnamed struct inside an union Message-ID: <20070824155210.GN7552@adacore.com> References: <46C4D20E.1010703@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46C4D20E.1010703@linux.vnet.ibm.com> User-Agent: Mutt/1.4.2.2i 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-08/txt/msg00462.txt.bz2 Carlos, > The attached patched fixes an issue described on this post: > > http://sourceware.org/ml/gdb-patches/2002-04/msg01114.html > 2007-08-16 Carlos Eduardo Seo > > gdb/c-typeprint.c (c_type_print_base): check value of > TYPE_NFIELDS (type) when displaying members of an > unnamed struct inside an union. Could you add a testcase for this issue? Being new at reviewing other people's patches, it's sometimes hard for me to understand what you are trying to do. A testcase would help in two ways: not only ensure that we do not regress in the future, but also help me understand clearly what it is that we're trying to fix. Thank you! > Index: src-git/gdb/c-typeprint.c > =================================================================== > --- src-git.orig/gdb/c-typeprint.c 2007-08-16 15:28:04.000000000 -0700 > +++ src-git/gdb/c-typeprint.c 2007-08-16 15:29:07.000000000 -0700 > @@ -735,7 +735,7 @@ > fputs_filtered (" ", stream); > } > wrap_here (" "); > - if (show < 0) > + if ((show < 0) && (TYPE_NFIELDS (type) == 0)) > { > /* If we just printed a tag name, no need to print anything else. */ > if (TYPE_TAG_NAME (type) == NULL) -- Joel