Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)

add-symbol-file filename
address, add-symbol-file
The add-symbol-file command reads additional symbol table
information from the file filename. You would use this
command when filename has been dynamically loaded (by
filename address [ -readnow ]
some other means) into the program that is running.
[ -mapped ], add-symbol-file
address should be the memory address at which the file
filename address
has been loaded; GDB cannot figure this out for itself. You
data_address bss_address,
can specify up to three addresses, in which case they are
add-symbol-file filename
-section address
taken to be the addresses of the text, data, and bss segments
respectively. For complicated cases, you can specify an
arbitrary number of -ssection address pairs, to give an
explicit section name and base address for that section. You
can specify any address as an expression.
The symbol table of the file filename is added to the symbol
table originally read with the symbol-file command. You can
use the add-symbol-file command any number of times; the
new symbol data thus read keeps adding to the old. To
discard all old symbol data instead, use the symbol-file
command without any arguments.
add-symbol-file does not repeat if you press RET after using
it.
You can use the `-mapped' and `-readnow' options just as
with the symbol- file command, to change how GDB
manages the symbol table information for filename.
section The section command changes the base address of
section SECTION of the exec file to ADDR. This can be used
if the exec file does not contain section addresses, (such as
in the a.out format), or when the addresses specified in
the file itself are wrong. Each section must be changed
separately. The info files command, described below, lists
all the sections and their addresses.
info files, info target info files and info target are synonymous; both
commands print the current target (see Chapter 13
(page 94)), including the names of the executable and core
dump files currently in use by GDB, and the files from which
symbols were loaded. Both the commands list all possible
targets rather than the current targets.
All file-specifying commands allow both absolute and relative file names as arguments. GDB always
converts the file name to an absolute file name and remembers it that way.
GDB automatically loads symbol definitions from shared libraries when you use the run command,
or when you examine a core file. (Before you issue the run command, GDB does not understand
references to a function in a shared library, however ― unless you are debugging a core file).
On HP-UX, if the program loads a library explicitly, GDB automatically loads the symbols at the
time of the shl_load call. See “Breakpoints” (page 36), for more information.
info share, info
sharedlibrary
Print the names of the shared libraries which are currently loaded.
sharedlibrary regex, share
regex
Load shared object library symbols for files matching a Unix regular
expression. As with files loaded automatically, it only loads shared
libraries required by your program for a core file or after typing
run. If regex is omitted all shared libraries required by your
program are loaded.
90 GDB Files