From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4930 invoked by alias); 12 May 2010 13:27:04 -0000 Received: (qmail 4922 invoked by uid 22791); 12 May 2010 13:27:03 -0000 X-SWARE-Spam-Status: No, hits=-0.7 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.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 May 2010 13:26:58 +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 o4CDQse1076429 for ; Wed, 12 May 2010 15:26:55 +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 o4CDQs7L069825 for ; Wed, 12 May 2010 15:26:54 +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 o4CDQspU070558 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 12 May 2010 15:26:54 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] dwarf debug format: Support DW_AT_variable_parameter attribute Date: Wed, 12 May 2010 13:27:00 -0000 Message-ID: <002301caf1d6$d3ee0fd0$7bca2f70$@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/msg00258.txt.bz2 Free Pascal compiler has support for DW_AT_variable_parameter attribute, but this is disabled because GDB does not support it yet. The value of the attribute must be a flag according to DWARF specs. The only point I am unsure about is what does a zero value of this flag mean: Should zero be considered as FALSE and thus the should say that this parameter is NOT a variable parameter, or does the simple presence of this attribute condfirm this it is a variable parameter, no matter the value of the flag. I took the first approach here, but have the impression that it is not always the case inside dwarf2read.c code. The following patch adds support for this inside dwarf2read.c source. Tested on gcc16, no regression found. Is this OK? Pierre Muller Pascal language support maintainer for GDB 2010-05-12 Pierre Muller * dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter attribute. Index: src/gdb/dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.383 diff -u -p -r1.383 dwarf2read.c --- src/gdb/dwarf2read.c 8 May 2010 04:58:45 -0000 1.383 +++ src/gdb/dwarf2read.c 12 May 2010 13:00:17 -0000 @@ -8630,6 +8630,10 @@ 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)) + SYMBOL_CLASS (sym) = LOC_REF_ARG; + add_symbol_to_list (sym, cu->list_in_scope); break; case DW_TAG_unspecified_parameters: