Re: gdb symbol lookup very slow
Andrew Burgess <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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