From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25650 invoked by alias); 12 Dec 2011 21:39:04 -0000 Received: (qmail 25641 invoked by uid 22791); 12 Dec 2011 21:39:03 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Dec 2011 21:38:45 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBCLciGX014273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Dec 2011 16:38:44 -0500 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBCLcgpt000975 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 12 Dec 2011 16:38:44 -0500 Message-ID: <4EE67462.5040203@redhat.com> Date: Tue, 13 Dec 2011 01:28:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org ml" Subject: Re: [RFA] mi/10586 References: <4EBD93D9.2020006@redhat.com> <4EC157F6.1030503@redhat.com> <4EC16BD8.90309@redhat.com> <4EC29CF7.40204@redhat.com> <4ED95103.8030204@redhat.com> In-Reply-To: <4ED95103.8030204@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2011-12/txt/msg00356.txt.bz2 Ping On 12/02/2011 02:28 PM, Keith Seitz wrote: > On 11/15/2011 09:10 AM, Keith Seitz wrote: >> On 11/14/2011 12:28 PM, Tom Tromey wrote: >> >>> Actually, thinking about it more, it seems to me that it would be ok for >>> these cases to just be errors. There's no really good way to refer to >>> the anonymous field as its own entity, and I don't think we should hack >>> up the parser and whatever else to support this. >> >> An error... I'm not so sure that I like that, but to be honest, I'm not >> sure I like/dislike it sufficiently to argue about it. > > Ok, so in the end, I've decided against making this an error. Instead, > what I've implemented is analogous to how varobj/MI currently deal with > the CPLUS_FAKE_CHILD cases: path expressions and the like are "". > > If you would like me to do otherwise, please let me know. > > I am attaching the latest incarnation of this patch, which covers all > these cases (AFAIK) and utilizes the new varobj tree testing that I > committed last week. > > What do you think? > > Keith > > ChangeLog > 2011-12-02 Keith Seitz > > PR mi/10586 > Based on work by Nick Roberts : > * varobj.c [ANONYMOUS_STRUCT_NAME]: New constant. > [ANONYMOUS_UNION_NAME]: Likewise. > (is_anonymous_child): New function. > (create_child_with_value): If the child is nameless, > synthesize a name for it. > (c_describe_child): If the child has no field or type names > for a union or sturct, use ANONYMOUS_STRUCT_NAME or > ANONYMOUS_UNION_NAME. > Set path expression for these fields to the empty string. > (cplus_describe_child): Likewise. > (is_path_expr_parent): New function. > (get_path_expr_parent): New function. > > testsuite/ChangeLog > 2011-12-02 Keith Seitz > > PR mi/10586 > * gdb.mi/mi-var-cp.cc (anonymous_structs): New function. > (class A): New class. > (class B): New class. > (main): Call anonymous_structs. > * gdb.mi/mi-var-cp.exp: Add anonymous struct tests and > adjust test results. > * gdb.mi/mi2-var-cp.exp: Likewise. > * gdb.mi/var-cmd.c (struct _simple_struct): Add two anonymous > structs. > * gdb.mi/mi-var-dislay.exp: Add anonymous struct tests and > adjust test results. > * gdb.mi/mi2-var-display.exp: Likewise.