From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13105 invoked by alias); 7 Jan 2003 23:56:39 -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 12827 invoked from network); 7 Jan 2003 23:55:22 -0000 Received: from unknown (HELO tully.CS.Berkeley.EDU) (128.32.153.227) by 209.249.29.67 with SMTP; 7 Jan 2003 23:55:22 -0000 Received: from tully.CS.Berkeley.EDU (hilfingr@localhost) by tully.CS.Berkeley.EDU (8.9.1a/8.9.1) with ESMTP id PAA18230; Tue, 7 Jan 2003 15:54:36 -0800 (PST) Message-Id: <200301072354.PAA18230@tully.CS.Berkeley.EDU> To: Elena Zannoni , Adam Fedor , GDB Patches , Daniel Jacobowitz Subject: Demangling and searches MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18225.1041983676.1@tully.CS.Berkeley.EDU> Date: Tue, 07 Jan 2003 23:56:00 -0000 From: Paul Hilfinger X-SW-Source: 2003-01/txt/msg00066.txt.bz2 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. We do very little demangling as a result, and do not devote any storage to demangled names. Of course, we do have to demangle during the 'info XXX' symbol searches, but that is not a common operation (at least for our customers), and therefore we saw little to be gained by storing the demangled names. Is there some unfortunate feature of C++ and ObjC mangling that completely prevents our approach for those languages? What was the rationale behind the current strategy? Thanks for the information. Paul Hilfinger