Shared libraries

You can use the following commands when working with shared libraries:

sharedlibrary [regexp]
Load shared object library symbols for files matching the given regular expression, regexp. If regexp is omitted, GDB tries to load symbols for all loaded shared libraries.
info sharedlibrary
Display the status of the loaded shared object libraries.

The following parameters apply to shared libraries:

set solib-search-path dir[:dir...]
Set the search path for loading shared library symbols files that don't have an absolute path. This path overrides the PATH and LD_LIBRARY_PATH environment variables.
set solib-absolute-prefix prefix
Set the prefix for loading absolute shared library symbol files.
set auto-solib-add value
Make the loading of shared library symbols automatic or manual:
  • If value is nonzero, symbols from all shared object libraries are loaded automatically when the inferior process (i.e., the one being debugged) begins execution, or when the dynamic linker informs GDB that a new library has been loaded.
  • If value is zero, symbols must be loaded manually with the sharedlibrary command.

You can query the settings of these parameters with the show solib-search-path, show solib-absolute-prefix, and show auto-solib-add commands.