From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12142 invoked by alias); 30 Apr 2010 08:20:15 -0000 Received: (qmail 12128 invoked by uid 22791); 30 Apr 2010 08:20:12 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Fri, 30 Apr 2010 08:20:04 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3U8K3di001557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Apr 2010 04:20:03 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3U8K0sm014713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 Apr 2010 04:20:02 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o3U8K0lu014099; Fri, 30 Apr 2010 10:20:00 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o3U8JxDF014098; Fri, 30 Apr 2010 10:19:59 +0200 Date: Fri, 30 Apr 2010 08:20:00 -0000 From: Jan Kratochvil To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFA] PR 11530: Fix and test case Message-ID: <20100430081959.GB12043@host0.dyn.jankratochvil.net> References: <001b01cae7e5$f46d47d0$dd47d770$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001b01cae7e5$f46d47d0$dd47d770$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-04/txt/msg00981.txt.bz2 On Thu, 29 Apr 2010 23:50:15 +0200, Pierre Muller wrote: > --- src/gdb/gdbtypes.c 21 Apr 2010 23:21:03 -0000 1.189 > +++ src/gdb/gdbtypes.c 29 Apr 2010 21:23:35 -0000 > @@ -1246,6 +1246,13 @@ lookup_struct_elt_type (struct type *typ > { > return TYPE_FIELD_TYPE (type, i); > } > + else if (!t_field_name || *t_field_name == '\0') > + { > + struct type *subtype = lookup_struct_elt_type ( > + TYPE_FIELD_TYPE (type, i), name, 1); IMO struct type *subtype; subtype = lookup_struct_elt_type TYPE_FIELD_TYPE (type, i), name, 1); > + if (subtype != NULL) > + return subtype; > + } > } I was now thinking about a possible name clash. As these anonymous structs/unions are a GNU extension there is no offical standard for it but the GCC texinfo file describes it as an error which GCC currently does not report. I have not found a GCC PR for it. ------------------------------------------------------------------------------ (gcc)Unnamed Fields You must never create such structures that cause ambiguous field definitions. For example, this structure: struct { int a; struct { int a; }; } foo; It is ambiguous which `a' is being referred to with `foo.a'. Such constructs are not supported and must be avoided. In the future, such constructs may be detected and treated as compilation errors. ------------------------------------------------------------------------------ > +struct a > + { > + union > + { > + int i; > + }; > + } a; Possibly to test also `struct' there to get better test coverage. > +if { ![runto main] } then { runto_main But I do not understand how those embedded remote stubs work. Thanks, Jan