Chapter 17. gdb Files
141
add-symbol-file
filename address
add-symbol-file
filename address
[ -readnow ] [ -mapped ]
add-symbol-file
filename
-s
section address
...
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
some other means) into the program that is running.
address
should be the memory address at
which the file has been loaded; gdb cannot figure this out for itself. You can additionally specify
an arbitrary number of
-s
section 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.
Although
filename
is typically a shared library file, an executable file, or some other object file
which has been fully relocated for loading into a process, you can also load symbolic information
from relocatable
.o
files, as long as:
•
the file’s symbolic information refers only to linker symbols defined in that file, not to symbols
defined by other object files,
•
every section the file’s symbolic information refers to has actually been loaded into the inferior,
as it appears in the file, and
•
you can determine the address at which every section was loaded, and provide these to the
add-symbol-file
command.
Some embedded operating systems, like Sun Chorus and VxWorks, can load relocatable files
into an already running program; such systems typically make the requirements above easy to
meet. However, it’s important to recognize that many native systems use complex link procedures
(
.linkonce
section factoring and C++ constructor table assembly, for example) that make the
requirements difficult to meet. In general, one cannot assume that using
add-symbol-file
to
read a relocatable object file’s symbolic information will have the same effect as linking the
relocatable object file into the program in the normal way.
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
.
add-shared-symbol-file
The
add-shared-symbol-file
command can be used only under Harris’ CXUX operating
system for the Motorola 88k. gdb automatically looks for shared libraries, however if gdb does
not find yours, you can run
add-shared-symbol-file
. It takes no arguments.
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 sepa-
rately. 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 print the current target (refer to Chapter
18
Specifying a Debugging Target
), including the names of the executable and core dump files
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......