From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19156 invoked by alias); 20 Nov 2003 16:54: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 19141 invoked from network); 20 Nov 2003 16:54:38 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 20 Nov 2003 16:54:38 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id D3B6E2B8F; Thu, 20 Nov 2003 11:54:33 -0500 (EST) Message-ID: <3FBCF1C9.5040106@redhat.com> Date: Thu, 20 Nov 2003 16:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Will Cohen , gdb@sources.redhat.com Subject: Re: Slow handling of C++ symbol names References: <3FBBDC27.50204@redhat.com> <20031119211355.GA31069@nevyn.them.org> <3FBCE71B.7060100@redhat.com> <20031120161915.GA1282@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-11/txt/msg00171.txt.bz2 > > Well, I remember fixing some startup time issues since then :P For > instance, the cache shared between minimal and partial symbols should > cut demangling time about in half. Ah, this: symbol_set_names? I was looking at the demangler. > Which leads to the question. Why does GDB demangle symbols? My >> simplistic understanding of the code is that GDB only needs the "iw" >> (a.k.a., demangled string up to but excluding the lparen and ignoring >> white space) part of the symbol in the search table (the rest isn't so >> critical and can be constructed on-demand). > > > A substantial amount of demangling is needed to produce the part of > the symbol before the lparen; consider templates. Also, we need the > full names in the minimal symbol for break 'foo(int)' with quotes to > work. And there are assumptions of unique symbol names in our > hashing/searching, IIRC. But without looking at the data we've no idea how substantial any particular part really is. For instance, when analysing the bcache found that when debugging a C program every entry is 28 bytes in size! 'foo(int)' can be broken down into "foo" "(int)" the latter only being demanged and stored on-demand. > I'm sure there are tricks we can do to cut down on how early or often > we demangle, but it still seems to be necessary.