From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12162 invoked by alias); 5 May 2010 21:44:59 -0000 Received: (qmail 12150 invoked by uid 22791); 5 May 2010 21:44:58 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,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.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 May 2010 21:44:52 +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 o45Lidw4032122 ; Wed, 5 May 2010 23:44:39 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o45Licsh018712 ; Wed, 5 May 2010 23:44:39 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o45LibpR001673 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Wed, 5 May 2010 23:44:38 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Cc: "'Jan Kratochvil'" , References: <001b01cae7e5$f46d47d0$dd47d770$@muller@ics-cnrs.unistra.fr> <20100430081959.GB12043@host0.dyn.jankratochvil.net> <15700.946111656$1272633144@news.gmane.org> In-Reply-To: Subject: RE: [RFA] PR 11530: Fix and test case Date: Wed, 05 May 2010 21:44:00 -0000 Message-ID: <003001caec9c$2ef93de0$8cebb9a0$@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-05/txt/msg00131.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Tom Tromey > Envoy=E9=A0: Friday, April 30, 2010 7:30 PM > =C0=A0: Pierre Muller > Cc=A0: 'Jan Kratochvil'; gdb-patches@sourceware.org > Objet=A0: Re: [RFA] PR 11530: Fix and test case >=20 > >>>>> "Pierre" =3D=3D Pierre Muller > writes: >=20 > Pierre> I just want to fix the simple case in which there is > Pierre> no, name conflict. >=20 > It seems pretty reasonable to me. >=20 > Pierre> With my patch, GDB will find the first instance > Pierre> that matches the field name, but I don't even know > Pierre> if the ordering given by the debug information necessarily > Pierre> follows the definition order in the source! >=20 > I skimmed this part of the DWARF 4 spec (5.5.6 Data Member Entries) but > I didn't see any such requirement. >=20 > I'm not too concerned about this. >=20 > Pierre> Anyhow, this patch is only useful for sizeof (), > Pierre> not for printing of the value itself, which > Pierre> was already working... >=20 > That is interesting. Why does it work in one case but not the other? for the first test 'p a.i' gdb calls search_struct_field, which has already some code (around line 1842) to cope for unnamed fields. There was no equivalent in the lookup_struct_elt_type function. By the way, the search_struct_field function also allows a union called "else" to be searched. Should this also be inserted into lookup_struct_elt_type or is this only a left over from Chill language? Pierre