2

On my fedora box I have installed a lot of separate debug infos.

sudo dnf debuginfo-install <list of packets>

Now, if I debug some simple code it needs very long until some symbol is displayed or some values are printed. It is quite clear that is absolutly needed to evaluate all the installed symbol files to get all information.

But if I have a problem, say on a lib like goocanvas I only want to have my local debug smbols generated with my own compiled code with -g option and the only the debug infos for goocanvas libs.

How can that kind of selection be achieved? Only by renaming the folder of debug info files and generate a copy of needed ones? Maybe as a symlink? Or is there a common selection option anywhere?

Klaus
  • 24,205
  • 7
  • 58
  • 113

1 Answers1

2

You can skip all debug info from shared libraries and only load goocanvas lib symbols. Here is a sample of how to do it in gdb session:

[ ~]$ gdb -q /your/binary
(gdb) set auto-solib-add off 
(gdb) start 

Temporary breakpoint 1, 0x000055555564edd0 in main ()
(gdb) sharedlibrary goocanvas

From gdb doc:

If your program uses lots of shared libraries with debug info that takes large amounts of memory, you can decrease the gdb memory footprint by preventing it from automatically loading the symbols from shared libraries. To that end, type set auto-solib-add off before running the inferior, then load each library whose debug symbols you do need with sharedlibrary regexp, where regexp is a regular expression that matches the libraries whose symbols you want to be loaded.

See also this related question: How to prevent GDB from loading debugging symbol for a (large) library?

Community
  • 1
  • 1
ks1322
  • 33,961
  • 14
  • 109
  • 164