You can point a single symbol file to gdb with command the:
symbol-file /usr/lib/debug/symbolfile.so
But how to tell gdb to load all symbol-files from given path including subdirectories?
You can point a single symbol file to gdb with command the:
symbol-file /usr/lib/debug/symbolfile.so
But how to tell gdb to load all symbol-files from given path including subdirectories?
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.
The solution is to add-symbol-file
. For instance, if symbol file is called lib.out
:
add-symbol-file lib.out 0
This is particularly useful on embedded system where application developers use a library stored in ROM. The debugger needs the symbol file to reconstruct the stack if execution stops in the middle of a library function call. This works even if the library was generated on a separate system to which the developers have no access.