From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6043 invoked by alias); 28 May 2014 08:56:12 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 5972 invoked by uid 89); 28 May 2014 08:56:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-gw3-out.broadcom.com Received: from mail-gw3-out.broadcom.com (HELO mail-gw3-out.broadcom.com) (216.31.210.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 May 2014 08:56:10 +0000 Received: from irvexchcas06.broadcom.com (HELO IRVEXCHCAS06.corp.ad.broadcom.com) ([10.9.208.53]) by mail-gw3-out.broadcom.com with ESMTP; 28 May 2014 01:57:58 -0700 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS06.corp.ad.broadcom.com (10.9.208.53) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 28 May 2014 01:56:08 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.174.1; Wed, 28 May 2014 01:56:07 -0700 Received: from [10.177.72.92] (unknown [10.177.72.92]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 241B49F9F7; Wed, 28 May 2014 01:56:07 -0700 (PDT) Message-ID: <5385A4A7.2010909@broadcom.com> Date: Wed, 28 May 2014 22:43:00 -0000 From: Andrew Burgess User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: CC: Subject: Re: gdb symbol lookup very slow References: <53859746.7030601@cavallinux.eu> In-Reply-To: <53859746.7030601@cavallinux.eu> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00078.txt.bz2 On 28/05/2014 8:59 AM, Antonio Cavallo wrote: > I'm having hard time debugging a (very large) C++ library under gdb (gdb > 7.7.1, gcc 4.8, binutils 2.22). Details of your target architecture / operating system /etc would be helpful. > > The main issue is the time it takes to reach a breakpoint: gdb takes an > insane amount of time (order of 2mins) vs vs2012 (a couple of seconds). > > I've profiled gdb and the top functions called during the debugging are > (more than 90% is spent in these): > > strcmp_iw > find_pc_sect_psymtab > symbol_get_demangled_name > symbol_search_name > > I suspect gdb doesn't cache the symbols: is there any way to speedup > this lookup? Is there any other explanation for why gdb is so much > slower than visual studio? I suspect you've not mentioned something important :) In "normal" circumstances, once a breakpoint has been placed, and the program being debugged has been resumed, then there should be no time spent inside gdb. Are you by chance using conditional breakpoints? Or stepping, or using some other commands? The best thing would be to post a small example session, an annotate which commands you feel are taking longer than expected. Also, you mention that you profiled gdb, assuming that it's not too large, making the profile data available might allow some more insight. Thanks for reporting this issue, and taking the time to investigate it. Andrew