From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13416 invoked by alias); 11 Sep 2008 22:15:06 -0000 Received: (qmail 13364 invoked by uid 22791); 11 Sep 2008 22:15:05 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Sep 2008 22:14:27 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m8BMDLPj020483; Thu, 11 Sep 2008 18:13:41 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8BMDAtw005986; Thu, 11 Sep 2008 18:13:10 -0400 Received: from opsy.redhat.com (vpn-10-25.bos.redhat.com [10.16.10.25]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m8BMD9s4005741; Thu, 11 Sep 2008 18:13:09 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 0B01A3785D2; Thu, 11 Sep 2008 16:13:25 -0600 (MDT) To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA/commit/dwarf] Create partial symbols for nested subprograms References: <20080910201959.GC10133@adacore.com> <20080910203437.GA26162@caradoc.them.org> <20080911050018.GR12222@adacore.com> From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Thu, 11 Sep 2008 22:15:00 -0000 In-Reply-To: <20080911050018.GR12222@adacore.com> (Joel Brobecker's message of "Wed\, 10 Sep 2008 22\:00\:18 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-09/txt/msg00244.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Daniel> Not that I see any useful way around it, if subprograms really Daniel> can be children of lexical blocks. Tom> Can we do it only for languages where we know this can occur? Tom> IOW, Ada? Joel> That's what I was going to propose, but I wanted to do some measurement Joel> too (tomorrow). Nested subprograms are possible in C, and aren't they Joel> also available in C++? I don't mind supporting this only in Ada, though. GNU C has nested functions. Standard C does not. I wrote a simple test case and compiled it with GCC. The resulting DWARF (I appended a snippet) does not nest functions here .. but perhaps this is a bug in GCC, I couldn't say. I don't know the situation with C++. Tom <0>: Abbrev Number: 1 (DW_TAG_compile_unit) < c> DW_AT_stmt_list : 0 <10> DW_AT_high_pc : 0x17 <14> DW_AT_low_pc : 0 <18> DW_AT_producer : GNU C 4.1.2 20070925 (Red Hat 4.1.2-33) <40> DW_AT_language : 1 (ANSI C) <41> DW_AT_name : q.c <45> DW_AT_comp_dir : /tmp <1><4a>: Abbrev Number: 2 (DW_TAG_subprogram) <4b> DW_AT_sibling : <84> <4f> DW_AT_external : 1 <50> DW_AT_name : outer <56> DW_AT_decl_file : 1 <57> DW_AT_decl_line : 2 <58> DW_AT_prototyped : 1 <59> DW_AT_type : <84> <5d> DW_AT_low_pc : 0 <61> DW_AT_high_pc : 0xd <65> DW_AT_frame_base : 0 (location list) <2><69>: Abbrev Number: 3 (DW_TAG_subprogram) <6a> DW_AT_name : inner <70> DW_AT_decl_file : 1 <71> DW_AT_decl_line : 3 <72> DW_AT_prototyped : 1 <73> DW_AT_type : <84> <77> DW_AT_low_pc : 0xd <7b> DW_AT_high_pc : 0x17 <7f> DW_AT_frame_base : 0x2c (location list)