add-symbol-file filename address
add-symbol-file filename address [ -readnow ] [ -mapped ]
add-symbol-file filename -ssection address ...
add-symbol-file
command reads additional symbol tableinformation from the file filename. You would use this commandwhen filename has been dynamically loaded (by some other means)into the program that is running. address should be the memoryaddress at which the file has been loaded; GDB cannot figurethis out for itself. You can additionally specify an arbitrary numberof `-ssection address' pairs, to give an explicitsection 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 tableoriginally read with the symbol-file
command. You can use theadd-symbol-file
command any number of times; the new symbol datathus read keeps adding to the old. To discard all old symbol datainstead, use the symbol-file
command without any arguments.
Although filename is typically a shared library file, anexecutable file, or some other object file which has been fullyrelocated for loading into a process, you can also load symbolicinformation from relocatable `.o' files, as long as:
add-symbol-file
command.Some embedded operating systems, like Sun Chorus and VxWorks, can loadrelocatable files into an already running program; such systemstypically make the requirements above easy to meet. However, it'simportant to recognize that many native systems use complex linkprocedures (.linkonce
section factoring and C++ constructor tableassembly, for example) that make the requirements difficult to meet. Ingeneral, one cannot assume that using add-symbol-file
to read arelocatable object file's symbolic information will have the same effectas linking the relocatable object file into the program in the normalway.
add-symbol-file
does not repeat if you press RET after using it.
You can use the `-mapped' and `-readnow' options just as withthe symbol-file
command, to change how GDB manages the symboltable information for filename.