From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8236 invoked by alias); 19 May 2010 22:34:47 -0000 Received: (qmail 8227 invoked by uid 22791); 19 May 2010 22:34:46 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 May 2010 22:34:42 +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 o4JMY31R057097 ; Thu, 20 May 2010 00:34:04 +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 o4JMY10X008754 ; Thu, 20 May 2010 00:34:03 +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 o4JMXxh8093945 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 20 May 2010 00:34:00 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Cc: "'Joel Brobecker'" , , "'FPC Core Developer List'" References: <8830.7035308846$1273670829@news.gmane.org> <20100517172758.GJ2805@adacore.com> <000301caf5e7$222ac800$66805800$@muller@ics-cnrs.unistra.fr> <20100517174726.GK2805@adacore.com> <44296.7587885962$1274132782@news.gmane.org> <28559.2589797036$1274302480@news.gmane.org> In-Reply-To: Subject: [RFA-v2] dwarf debug format: Support DW_AT_variable_parameter attribute Date: Wed, 19 May 2010 23:34:00 -0000 Message-ID: <001501caf7a3$6571fee0$3055fca0$@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/msg00401.txt.bz2 So, here is a new version of this patch. I will try to improve reference type handling inside the pascal specific sources later. Does that look OK? Pierre =20 2010-05-20 Pierre Muller * dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter attribute. Index: dwarf2read.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.386 diff -u -p -r1.386 dwarf2read.c --- dwarf2read.c 17 May 2010 15:55:01 -0000 1.386 +++ dwarf2read.c 19 May 2010 22:29:04 -0000 @@ -8662,6 +8662,15 @@ new_symbol (struct die_info *die, struct { dwarf2_const_value (attr, sym, cu); } + attr =3D dwarf2_attr (die, DW_AT_variable_parameter, cu); + if (attr && DW_UNSND (attr)) + { + struct type *ref_type; + + ref_type =3D lookup_reference_type (SYMBOL_TYPE (sym)); + SYMBOL_TYPE (sym) =3D ref_type; + } + add_symbol_to_list (sym, cu->list_in_scope); break; case DW_TAG_unspecified_parameters: > -----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: Thursday, May 20, 2010 12:09 AM > =C0=A0: Pierre Muller > Cc=A0: 'Joel Brobecker'; gdb-patches@sourceware.org; 'FPC Core Developer > List' > Objet=A0: Re: [RFA] dwarf debug format: Support DW_AT_variable_parameter > attribute >=20 > >>>>> "Pierre" =3D=3D Pierre Muller > writes: >=20 > Pierre> That is what is done for now on Free Pascal, > Pierre> i.e. the debug information generates a reference_type for > Pierre> parameters passed by var. > Pierre> It's not ideal yet, but this is just a matter of > Pierre> twicks inside p-* files... >=20 > I suppose it is less than ideal in that the type is exposed to the > user. >=20 > Another idea would be to augment the DWARF expression evaluator to do > an > additional indirection when this bit is set. Though then one must > wonder why the compiler does not simply emit an expression to that > effect. >=20 > Pierre> I am unsure about the type allocation procedure, > Pierre> could you just tell me if this looks OK > Pierre> before I resubmit an RFA. >=20 > Pierre> + struct type *ref_type; > Pierre> + > Pierre> + ref_type =3D TYPE_REFERENCE_TYPE (SYMBOL_TYPE > (sym)); > Pierre> + if (!ref_type) > Pierre> + { > Pierre> + ref_type =3D alloc_type (objfile); > Pierre> + ref_type =3D make_reference_type (SYMBOL_TYPE > (sym), > Pierre> &ref_type); > Pierre> + } >=20 > Just use 'lookup_reference_type (SYMBOL_TYPE (sym))'. > That will handle the details for you. >=20 > Tom