From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17387 invoked by alias); 29 Aug 2007 20:41:24 -0000 Received: (qmail 17368 invoked by uid 22791); 29 Aug 2007 20:41:23 -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; Wed, 29 Aug 2007 20:41:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 69BDC2AA45B; Wed, 29 Aug 2007 16:41:16 -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 JeIO8OKEX25C; Wed, 29 Aug 2007 16:41:16 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 318ED2A966E; Wed, 29 Aug 2007 16:41:16 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 0FE0DE7B58; Wed, 29 Aug 2007 13:41:14 -0700 (PDT) Date: Wed, 29 Aug 2007 20:41:00 -0000 From: Joel Brobecker To: Carlos Eduardo Seo Cc: Luis Machado , gdb-patches@sourceware.org Subject: Re: [patch] ptype: show members of an unnamed struct inside an union Message-ID: <20070829204114.GH3795@adacore.com> References: <20070828203420.GB3795@adacore.com> <20070829025618.GA26311@caradoc.them.org> <20070829043633.GD3795@adacore.com> <20070829163021.GA32337@caradoc.them.org> <20070829183215.GF3795@adacore.com> <20070829183643.GA9026@caradoc.them.org> <20070829184824.GG3795@adacore.com> <46D5D3AE.4010209@linux.vnet.ibm.com> <20070829202339.GA14859@caradoc.them.org> <46D5D674.4040600@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46D5D674.4040600@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/msg00526.txt.bz2 > > This isn't the same as what we were talking about. This is when > > the type has no name; an anonymous union is when the field has no > > name. > > > > This might be a good idea too - I'm not decided on that... > > > IMHO, I think this is more informative to the user. But that's just my > $0.02... :) I agree with Daniel. Doing what you propose is partly defeating what the current code is doing, only because the type is anonymous. In the case of large structs which include other structs which include other structs, this makes a big difference in readability. The one reason I think it's a good idea to expand the field description when the field does not have a name, is because there is no way to get that information otherwise. But in the case of a named field that has an anonymous type, we can easily get the type information simply by selecting it (I mean by that: "ptype my_page.u" where u is the field name of your union). One last comment: The change you made is affecting both structs and unions. Is that what we want? So far, the discussion was only geared towards unions. -- Joel