From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9355 invoked by alias); 30 Jan 2008 22:58:57 -0000 Received: (qmail 9346 invoked by uid 22791); 30 Jan 2008 22:58:56 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Jan 2008 22:58:37 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AFDC42A97BF for ; Wed, 30 Jan 2008 17:58:35 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WsIBmGCZaecL for ; Wed, 30 Jan 2008 17:58:35 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 58A272A97AF for ; Wed, 30 Jan 2008 17:58:35 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 3EBAAE7ACB; Wed, 30 Jan 2008 14:58:33 -0800 (PST) Date: Wed, 30 Jan 2008 23:06:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFA/dwarf] save nested Ada subprograms as global symbol Message-ID: <20080130225833.GG12387@adacore.com> References: <20071227073938.GC10767@adacore.com> <20080129171610.GE2815@caradoc.them.org> <20080129214501.GF16288@adacore.com> <20080129221733.GI15063@caradoc.them.org> <20080130202816.GD12387@adacore.com> <20080130204208.GA3659@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080130204208.GA3659@caradoc.them.org> User-Agent: Mutt/1.4.2.2i 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-01/txt/msg00836.txt.bz2 > > > A closer analogy to nested procedures may be class methods. Are the > > > names of functions in packages normally relatively unique? How about > > > for nested functions? In C++, names within namespaces are relatively > > > unique, and method names are not ("next", "iterator", etc.). [...] > I meant the unqualified names. Are you likely to have a dozen > different procedures in your program, all containing a nested method > named "first"? It's hard to tell. I would guess that nested subprograms are not different in terms of naming from regular non-nested subprograms. > Oh. Well, that's much less reason to object then. I thought you were > putting "first" into the symbol table, but "pck.do_nothing.first" and > then finding that on searches for "first" bothers me much less. Ah, yes, I understand now where you are coming from. This is my fault, I should have been more complete in my first message. Sometimes, I overlook significant details that are obvious to me, but actually not obvious to someone not familiar with the GNAT compiler... > If you want to be able to use the name unqualified, then the global > symbol table sounds like the right place to put it. I'd like > namespace members and procedures containing nested functions to be > hierarchical elements in the symbol table, but that's not how it works > today. So is the original patch OK, then? > I'd suggest we do the same for nested C functions but it would be a > horrible mess; they don't have conveniently mangled or qualified names. For purely-C nested functions, doesn't it work already? Actually, I just gave it a try and I was able to break on my nested procedure. Given: int main (void) { void do_nothing (void) {}; do_nothing (); return 0; } I was able to break on "do_nothing" and run to it: (gdb) b do_nothing Breakpoint 1 at 0x8048355: file foo.c, line 5. (gdb) run Starting program: /[...]/foo Breakpoint 1, do_nothing () at foo.c:5 5 void do_nothing (void) {}; -- Joel