Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
NOTE: Limitations for the enhanced info target command on corefile are as follows:
• The enhanced info target command is not supported when the
expanded_node_host_names kernel parameter is set. It is supported only for the default
utsname.
• The heap segment listed in the memory segment does not contain mmapped memory for the
given core file.
Support for the dumpcore command
HP WDB provides the command, dumpcore to generate a core image file for a process running
under the debugger during execution.
The dumpcore command does not require any argument. It saves the core image for the current
process being debugged in the file named core.<pid>, where <pid> is the process ID number.
To dump the core for a live process, you must pass the following commands:
(gdb) run Starting program: sample Breakpoint 3, main () at sample.c:1010 b
= foo(a); (gdb) dumpcore Dumping core to the core file core.24091(gdb)
When starting from the HP WDB command line:
(gdb) file sample
Reading
symbols from sample...done
(gdb) set live-core 1
(gdb) core-file core.24091
Core was generated by 'sample'.#0 main () at sample.c:1010 b = foo(a);
(gdb) backtrace#0 main () at sample.c:10
(gdb)
When starting from the shell prompt:
% gdb --lcore a.out core.<pid>
For example:
% ./gdb --lcore sample core.24091
HP gdb...
Type "show warranty" for warranty/support....
Core was generated by 'sample'.#0 main () at sample.c:10
(gdb)
Enhancements to the dumpcore command
HP WDB provides an option for the dumpcore command, to specify a <core- filename>, to
generate a core image file of a process running under the debugger in the middle of execution
and saves it in the file named <core-filename>.
The dumpcore command with no arguments saves the core image for the current process being
debugged in the file named core.<pid>, where pid is the process ID number.
To analyze this core file with HP WDB on HP-UX 11i version 2, you must do the following:
• When starting from HP WDB command line:
(gdb) core-file [core.pid | core-filename]
• When starting from shell prompt:
$ gdb -core a.out [core.pid | core-filename]
Support for display of run time type information
HP WDB enables you to view the run time type information for C++ polymorphic object.
info rtti address
148 HP-UX Configuration-Specific Information