Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 119
If you specify both WDB_ROOT and GDB_ROOT, the value for GDB_ROOT is ignored.
HP WDB supports these environment variables to override the location of different
component of HP WDB.
Defined Variable WDB Location GDB location librtc.sl location
None /opt/langtools/bin /opt/langtools/bin /opt/langtools/lib
WDB_ROOT $WDB_ROOT/bin $WDB_ROOT/bin $WDB_ROOT/lib
GDB_ROOT n/a $GDB_ROOT/bin /opt/langtools/bin
GDB_SERVER n/a $GDB_SERVER n/a
LIBRTC_SERVER n/a n/a $LIBRTC_SERVER
Note: If you define WDB_ROOT or GDB_ROOT but do not create the correct directory struc-
ture below it, the debugger may fail.
14.6 Specifying object file directories
GDB enables automatic loading of debug information from object modules when an
application is compiled with the +objdebug option.
GDB uses the full path name to the object module files and searches the same directories
for source files.
Although this behavior is transparent, you can control when and how object files are
loaded with three commands:
objectdir path
Specifies a colon (:) separated list of directories in which GDB searches for ob-
ject files. These directories are added to the beginning of the existing objectdir
path. If you specify a directory that is already in the objectdir path, the spec-
ified directory is moved up in the objectdir path so that it is searched earlier.
GDB recognizes two special directory names: $cdir, which refers to the com-
pilation directory (if available) and $cwd, which tracks GDB’s current working
directory.
objectload file.c
Causes GDB to load the debug information for file.c immediately. The default
is to load debug information from object modules on demand.
objectretry file.c
Forces GDB to retry loading an object file if GDB encounters a file error while
reading an object module. File errors that might cause this include incorrect
permissions, file not found, or if the objectdir path changes. By default, GDB
does not try to read an object file after an error.
pathmap
Enables you to define a list of substitution rules to be applied to path names to
identify object files and the corresponding source files. The pathmap command,
however, may not find source files if the object files are not available.
This minimizes or eliminates the need to specify multiple objectdir commands
when object files are moved from the compilation directories or when compila-
tion directories are mounted over NFS.