144
Chapter 17. gdb Files
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.
On some systems, such as HP-UX systems, gdb supports autoloading shared library symbols until a
limiting threshold size is reached. This provides the benefit of allowing autoloading to remain on by
default, but avoids autoloading excessively large shared libraries, up to a threshold that is initially set,
but which you can modify if you wish.
Beyond that threshold, symbols from shared libraries must be explicitly loaded. To load these symbols,
use the command
sharedlibrary
filename
. The base address of the shared library is determined
automatically by gdb and need not be specified.
To display or set the threshold, use the commands:
set auto-solib-limit
threshold
Set the autoloading size threshold, in an integral number of megabytes. If
threshold
is nonzero
and shared library autoloading is enabled, symbols from all shared object libraries will be loaded
until the total size of the loaded shared library symbols exceeds this threshold. Otherwise, sym-
bols must be loaded manually, using the
sharedlibrary
command. The default threshold is
100 (that is, 100 Mb).
show auto-solib-limit
Display the current autoloading size threshold, in megabytes.
Shared libraries are also supported in many cross or remote debugging configurations. A copy of the
target’s libraries need to be present on the host system; they need to be the same as the target libraries,
although the copies on the target can be stripped as long as the copies on the host are not.
You need to tell gdb where the target libraries are, so that it can load the correct copies--otherwise, it
may try to load the host’s libraries. gdb has two variables to specify the search directories for target
libraries.
set solib-absolute-prefix
path
If this variable is set,
path
will be used as a prefix for any absolute shared library paths; many
runtime loaders store the absolute paths to the shared library in the target program’s memory. If
you use
solib-absolute-prefix
to find shared libraries, they need to be laid out in the same
way that they are on the target, with e.g. a
/usr/lib
hierarchy under
path
.
You can set the default value of
solib-absolute-prefix
by using the configure-time
-with-sysroot
option.
show solib-absolute-prefix
Display the current shared library prefix.
set solib-search-path
path
If this variable is set,
path
is a colon-separated list of directories to search for shared libraries.
solib-search-path
is used after
solib-absolute-prefix
fails to locate the library, or if
the path to the library is relative instead of absolute. If you want to use
solib-search-path
in-
stead of
solib-absolute-prefix
, be sure to set
solib-absolute-prefix
to a nonexistant
directory to prevent gdb from finding your host’s libraries.
Summary of Contents for ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Page 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......