From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20571 invoked by alias); 19 May 2010 20:54:34 -0000 Received: (qmail 20562 invoked by uid 22791); 19 May 2010 20:54:33 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_40,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.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 May 2010 20:54:27 +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 o4JKrmhX025484 ; Wed, 19 May 2010 22:53:48 +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 o4JKrlr7072417 ; Wed, 19 May 2010 22:53:47 +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 o4JKreNb050520 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Wed, 19 May 2010 22:53:45 +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> In-Reply-To: Subject: RE: [RFA] dwarf debug format: Support DW_AT_variable_parameter attribute Date: Wed, 19 May 2010 21:45:00 -0000 Message-ID: <000c01caf795$646be1e0$2d43a5a0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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/msg00397.txt.bz2 > Pierre> I fear that my patch will have to wait until > Pierre> this static expression evaluator is implemented... > > I'm not totally convinced that we would want such an evaluator. > > Could you change the type of a parameter marked with > DW_AT_variable_parameter to be a reference type instead? It seems to > me > that this would give the same result, or nearly so. That is what is done for now on Free Pascal, i.e. the debug information generates a reference_type for parameters passed by var. It's not ideal yet, but this is just a matter of twicks inside p-* files... The following patch does make the same as if the reference_type is created by Free Pascal. I am unsure about the type allocation procedure, could you just tell me if this looks OK before I resubmit an RFA. Pierre $ cvs diff -u -p dwarf2read.c Index: dwarf2read.c =================================================================== 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 20:52:42 -0000 @@ -8662,6 +8662,20 @@ new_symbol (struct die_info *die, struct { dwarf2_const_value (attr, sym, cu); } + attr = dwarf2_attr (die, DW_AT_variable_parameter, cu); + if (attr && DW_UNSND (attr)) + { + struct type *ref_type; + + ref_type = TYPE_REFERENCE_TYPE (SYMBOL_TYPE (sym)); + if (!ref_type) + { + ref_type = alloc_type (objfile); + ref_type = make_reference_type (SYMBOL_TYPE (sym), &ref_type); + } + SYMBOL_TYPE (sym) = ref_type; + } + add_symbol_to_list (sym, cu->list_in_scope); break; case DW_TAG_unspecified_parameters: