From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 538 invoked by alias); 8 Jan 2003 00:38:30 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 529 invoked from network); 8 Jan 2003 00:38:28 -0000 Received: from unknown (HELO mail.cdt.org) (206.112.85.61) by 209.249.29.67 with SMTP; 8 Jan 2003 00:38:28 -0000 Received: from dberlin.org (h-69-3-5-6.mclnva23.covad.net [69.3.5.6]) by mail.cdt.org (Postfix) with ESMTP id 41F4449010B; Tue, 7 Jan 2003 19:33:42 -0500 (EST) Received: from [192.168.1.102] (account dberlin HELO dberlin.org) by dberlin.org (CommuniGate Pro SMTP 4.0.3) with ESMTP-TLS id 2114899; Tue, 07 Jan 2003 19:38:15 -0500 Date: Wed, 08 Jan 2003 00:38:00 -0000 Subject: Re: Demangling and searches Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: Paul Hilfinger , Elena Zannoni , Adam Fedor , GDB Patches , Daniel Jacobowitz To: David Carlton From: Daniel Berlin In-Reply-To: Message-Id: <78152D27-22A1-11D7-9952-000393575BCC@dberlin.org> Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00069.txt.bz2 On Tuesday, January 7, 2003, at 07:13 PM, David Carlton wrote: > On Tue, 07 Jan 2003 15:54:36 -0800, Paul Hilfinger > said: > >> For some time, I've been meaning to ask a basic question about GDB >> search strategy: for language implementations that mangle their >> identifiers, the standard procedure in GDB at the moment is to >> search for the demangled identifier among the demangled identifiers >> of the symbol table, and to speed this search up by precomputing and >> storing the demangled symbol names. Why? > >> We used to do that for Ada mode in GDB, but subsequently changed our >> approach entirely. For Ada, we MANGLE the symbol we're searching >> for and then search among the MANGLED (i.e., raw, unmodified, >> warm-from- the-executable) names. > > I'm curious: in Ada, what does the mangling do? In particular, how > much type info does it contain? In C++, the mangled name contains > type info for the arguments for functions; I don't see how, using > GDB's current data structures, to allow us to allow users to, say, > break on a function without requiring them to specify the types of the > arguments, if we took your approach. (Though it might be possible to > modify GDB's data structures to allow that.) Further, the mangling is ABI dependent. Thus, you'd have to know what ABI the symbol you are looking up is going to use, to mangle it properly