views:

255

answers:

1

You can point a single symbol file to gdb with command symbol-file /usr/lib/debug/symbolfile.so

But how to tell gdb to load all symbol-files from given path including subdirectories?

A: 

On a Linux system, you should never have to use symbol-file GDB command in the first place.

The trick is to prepare your binaries in such a way that GDB will find the symbol file automatically. This is surprisingly easy to do. Detailed instructions are here.

Employed Russian
Well, lets assume I don't compile anything myself. For example after apt-get install libc-dbg. Should I move installed debug package by copying it somewhere before debugging?
Executing "apt-get install libc-dbg" should allow you to debug libc in GDB *without* any additional symbol-file commands. If it doesn't, then either you have a broken .gdbinit (most likely), a broken GDB, or a broken libc-dbg. I suggest you edit your question and provide as many details as possible, including what packages are installed and what they contain, as well as output from your actual GDB session with "gdb -nx -ex 'set verbose on' ./a.out".
Employed Russian