From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 723 invoked by alias); 2 Apr 2004 08:29:58 -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 697 invoked from network); 2 Apr 2004 08:29:56 -0000 Received: from unknown (HELO nile.gnat.com) (205.232.38.5) by sources.redhat.com with SMTP; 2 Apr 2004 08:29:56 -0000 Received: from localhost (localhost [127.0.0.1]) by nile.gnat.com (Postfix) with ESMTP id 3376CF2F3A; Fri, 2 Apr 2004 03:29:56 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 19197-01-8; Fri, 2 Apr 2004 03:29:55 -0500 (EST) Received: by nile.gnat.com (Postfix, from userid 1345) id CCEF3F2F2A; Fri, 2 Apr 2004 03:29:55 -0500 (EST) From: Paul Hilfinger To: drow@false.org Cc: gdb-patches@sources.redhat.com In-reply-to: <20040331221249.GA6811@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 31 Mar 2004 17:12:49 -0500) Subject: Re: [RFA] Introduce notion of "search name" References: <20040303191550.7307DF2DB8@nile.gnat.com> <20040305035955.GH5320@nevyn.them.org> <20040305103925.A4815F2EE4@nile.gnat.com> <20040331221249.GA6811@nevyn.them.org> Message-Id: <20040402082955.CCEF3F2F2A@nile.gnat.com> Date: Fri, 02 Apr 2004 08:29:00 -0000 X-Virus-Scanned: by amavisd-new at nile.gnat.com X-SW-Source: 2004-04/txt/msg00052.txt.bz2 >> So as an interim measure, I use your suggestion of 21 Jan and first >> try to find an objfile via the BFD section. When that doesn't work, I >> simply use a global hashtable to hold the demangled strings. Yes, >> that is a memory leak, but on consideration, I realized that it's only >> REALLY a memory leak if (a) I routinely change the entire set of >> demangled names numerous times during a single GDB session, or (b) >> demangle entirely different, large sets of names each time I reload >> the symbol tables. Yeah, I know, it's not pretty, but again I am hoping >> it will ensure that demangled names behave until the next interation of >> symtab modifications allow an entirely different strategy. > I'm not sure what others will think of this interim measure. I don't > like it much, though. I'm not overly fond of any of these solutions myself; they simply have effectiveness to recommend them. All I really need is to be able to find an objfile, *any* objfile really, whose lifetime is at least as great as the symbols are supposed to be. Or I could keep an obstack for this purpose, IF there were some way to know a safe time to reinitialize it (again, after the symbols die). > What you did not explain is how [SYMBOL_DEMANGLED_SEARCH_NAME] > is supposed to be different from SYMBOL_SEARCH_NAME. Well, the direct answer is that for Ada, SYMBOL_DEMANGLED_SEARCH_NAME (sym) == NULL whereas SYMBOL_SEARCH_NAME (sym) == the "linkage name" of the symbol Perhaps, now that you bring it up, it might be clearer simply to make this a predicate: SYMBOL_SEARCHED_BY_DEMANGLED_NAME (sym) or something like that? > The existing ada_demangle never fails. How does that interact with > what you said above? Hopefully not by tagging all minsyms as Ada! Ah, I have been putting off syncing the ada-* files with ours (they aren't compiled at the moment, and I feel no need to clutter the public file system with unused versions. However, perhaps it's time to check in the current versions, which are considerably different from the snapshot that's currently there. In short: you are quite right, and the current Ada demangler returns NULL for non-Ada-mangled symbols. Paul