Debugging Core Files Using HP WDB (5900-1573; WDB 6.2; January 2011)

The executable and the core file inherently carry information about the list of shared
libraries that were loaded at the instant of core dump. However, this list of shared libraries
is referenced by pathnames (the invoked path of the shared libraries on the system where
the core dump occurred).
If the shared libraries are located at a path that is different from the invoked path, you
must provide WDB with the path for the shared libraries.
To associate the appropriate versions of the shared libraries with the core file, set the
environment variable, GDB_SHLIB_PATH, as follows:
$ export GDB_SHLIB_PATH<path>
NOTE: You can use packcore, and unpackcore to pack, or unpack the core file
along with the relevant executable and libraries in a single tar file, and debug the core
file on a different system from the one on which the core file was invoked.
For more information on debugging a core file from a different system than the one on
which the core file was created, see “Debugging Core Files From a Different System”
(page 25)
Common Commands for Core File Debugging
Table 2 lists the common commands for core file debugging.
Table 2 Commonly Used Commands for Core File Debugging
DescriptionCommand
Debugging
Feature
Invokes the core file debugging feature in WDB.
If the executable path is not provided, the debugger
selects the invocation path of the process that generated
the core file. The invocation path information is stored in
the core file. If the invocation path is a relative path, you
must enter the executable while debugging the core file.
At the HP-UX prompt:
$ gdb a.out core
or
$ gdb a.out -c core
or
$ gdb -c core
Invoking the
core file
Displays the backtrace information about the process that
encountered the un-handled signal and the call chain
(including inlined functions). The backtrace is displayed
for the thread where the un-handled signal occurred.
All the stack frames are displayed if no arguments are
specified. If <COUNT> is specified, it display the innermost
COUNT frames. If a negative argument, <-COUNT>, is
specified, it displays the outermost COUNT frames.
backtrace [<-><count>]
where [<-><count>]
Viewing
backtrace
information
12