Debugging Core Files Using HP WDB (5900-1573; WDB 6.2; January 2011)
If you can reproduce the problem when running the program under WDB, it is easier to
use a live debugging session in WDB to debug the program, instead of debugging the
core file. However, the same debug information in the program can be used for core
file debugging.
Support for Invoking GDB Before a Program Aborts
WDB also provides the -crashdebug option to monitor the program execution and
invoke the debugger when the program execution is about to abort. This option provides
support for debugging a live process before the program aborts, instead of debugging
the core file after the program aborts.
Once the debugger is invoked, you can debug the application by using the common
debugger commands. You can examine the state of the process, make changes to the
state, and continue program execution, force a core dump, or terminate execution.
It also enables you to control program execution under the debugger if the program is
about to abort. You can load a new process or attach to a running process for monitoring.
To monitor a new process, enter the following command at the HP-UX prompt:
$ gdb -crashdebug [command][options]
To monitor and attach to a running process, enter the following command at the HP-UX
prompt:
$ gdb -crashdebug -pid [pid]
System Requirements for Core File Debugging
Table 1 lists the system requirements for debugging core files using WDB.
Table 1 System Requirements for Core File Debugging
DescriptionRequirement
HP–UX 11i v1, HP-UX 11i v2, or HP-UX 11i v3 on
HP 9000 systems
HP-UX 11i v2 or HP-UX 11i v3 on Integrity systems
Operating System
Commands For Core File Debugging
This section discusses the commands for debugging core files.
Invoking WDB to Debug Core Files
To invoke the debugger on the core file, enter one of the following commands:
• At the HP-UX prompt:
$ gdb a.out core
or
10