From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20276 invoked by alias); 19 May 2003 09:55:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20023 invoked from network); 19 May 2003 09:55:21 -0000 Received: from unknown (HELO nile.gnat.com) (205.232.38.5) by sources.redhat.com with SMTP; 19 May 2003 09:55:21 -0000 Received: by nile.gnat.com (Postfix, from userid 1345) id 38880F2D9E; Mon, 19 May 2003 05:55:21 -0400 (EDT) From: Paul Hilfinger To: ezannoni@redhat.com, carlton@math.stanford.edu, Cc: drow@mvista.com, cagney@redhat.com, gdb-patches@sources.redhat.com, jimb@redhat.com, brobecker@gnat.com Date: Mon, 19 May 2003 09:55:00 -0000 Subject: Re: [rfa] teach lookup_symbol about namespace scope Message-Id: <20030519095521.38880F2D9E@nile.gnat.com> X-SW-Source: 2003-05/txt/msg00332.txt.bz2 Yes, Ada does do things weirdly at the moment, and will probably continue to do so, but I don't think this need worry anybody. Our particular needs are: 1. We do NOT cache demangled names, and we look up all symbols using mangled names. Originally, we just followed C++, but changed when we discovered that our customers had HUGE executables for which the startup and memory costs became substantial. David Carlton expressed concern that our approach must cause maintenance problems, but to date (i.e., since early 1998), the approach has caused no problems for us. 2. We generally expect multiple symbol matches, rather than just taking the first match, and therefore our main lookup routine returns a list of symbols. 3. Linkage (mangled) names have the form __ and we need to be able to match this name given either either __ or . In our sources, I have introduced a macro SYMBOL_SEARCH_NAME that in the Ada case is equivalent to SYMBOL_LINKAGE_NAME and in other cases to the demangled name. As long as symbol tables (hash tables, etc.) are built and searched according to the search name, everything just works. To handle the need for a symbol list (as Elena mentions) we simply wrote our own lookup_symbol. We'll certainly take advantage of any opportunity to dump the latter code, of course, and will contribute little hooks if that's what it takes. However, it wasn't difficult to create our version in the first place and it has not been hard to maintain, so even in the worst case (i.e., we have to rewrite symbol lookup entirely) it will not be a terrible problem. Besides, I am confident that with the spiffy new design we're seeing, adaptation for Ada should be even easier than before. Paul Hilfinger