Question

I have a larger C++ programm with lot of templates which i want to debug. Unfortunately gdb takes several minutes to read the symbols.

http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html contains lots of options for debugging.

Which options would you suggest to make gdb faster/more usable.

Update: It looks like the slow down is caused by libtool. If gdb is launched via libtool --mode execute it is slow. If gdb is launched gdb .libs/foo it is reasonable fast. Any ideas why is much slower?

Update: Another suggestion was -fvisibility=hidden see http://gcc.gnu.org/wiki/Visibility

No correct solution

OTHER TIPS

Sometimes using -fdebug-types-section can make things a bit faster. It isn't guaranteed though.

Several minutes to load ... I wonder how big this executable is. If I were desperate I might try only compiling selected modules with debug info. Or perhaps look to see if it is a gdb bug. If it is split into an executable and some shared libraries, and some parts don't change very often, you could also look into using the "gdb index" feature (see the manual) to speed up the loading of debuginfo for those modules.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top