From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 838 invoked by alias); 30 Apr 2010 13:12:15 -0000 Received: (qmail 792 invoked by uid 22791); 30 Apr 2010 13:12:11 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Apr 2010 13:12:02 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3UDBkn7009860 ; Fri, 30 Apr 2010 15:11:46 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o3UDBjlq005343 ; Fri, 30 Apr 2010 15:11:46 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3UDBjFL038849 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Fri, 30 Apr 2010 15:11:45 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Jan Kratochvil'" Cc: References: <001b01cae7e5$f46d47d0$dd47d770$@muller@ics-cnrs.unistra.fr> <20100430081959.GB12043@host0.dyn.jankratochvil.net> In-Reply-To: <20100430081959.GB12043@host0.dyn.jankratochvil.net> Subject: RE: [RFA] PR 11530: Fix and test case Date: Fri, 30 Apr 2010 13:12:00 -0000 Message-ID: <000301cae866$b0cfff50$126ffdf0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00986.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Jan Kratochvil > Envoy=E9=A0: Friday, April 30, 2010 10:20 AM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFA] PR 11530: Fix and test case >=20 > 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 =3D=3D '\0') > > + { > > + struct type *subtype =3D lookup_struct_elt_type ( > > + TYPE_FIELD_TYPE (type, i), name, 1); >=20 > IMO > struct type *subtype; >=20 > subtype =3D lookup_struct_elt_type TYPE_FIELD_TYPE (type, i), > name, 1); This looks better, indeed. =20 > > + if (subtype !=3D NULL) > > + return subtype; > > + } > > } >=20 >=20 > 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. I don't want to try to test those GCC bugs I just want to fix the simple case in which there is no, name conflict. With my patch, GDB will find the first instance that matches the field name, but I don't even know=20 if the ordering given by the debug information necessarily=20 follows the definition order in the source! Anyhow, this patch is only useful for sizeof (), not for printing of the value itself, which was already working... Pierre Muller Pascal language support maintainer for GDB