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

$ aCC -g a.c
$ strip a.out
$ /opt/langtools/bin/gdb ./a.out core
HP gdb for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for
warranty/support.
..
warning: Load module ./a.out has been stripped.
Debugging information is not available.
(no debugging symbols found)...
Core was generated by `a.out'.
Program terminated with signal 11, Segmentation fault.
SEGV_ACCERR - Invalid Permissions for object
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...#0 0x40009b0:1 in generate_core_dump+0x21
()
(gdb) bt
#0 0x40009b0:1 in generate_core_dump+0x21 ()
#1 0x4000b40:0 in foo+0x110 ()
#2 0x4000bd0:0 in main+0x20 ()
(gdb)
Forcing a Core Dump
WDB enables you to force a core dump of a running process, and analyze the core file.
The dumpcore command forces a core dump and generates a core image file for a
process that is running under the debugger. If no arguments are given, it saves the core
image for the current debugged process in a file named core.<pid>, where <pid>
is the process ID number.
Before debugging a forced core dump, you must enter the set live-core 1 command
at the gdb prompt. The set live-core command enables the debugging of a core
file created by a forced core dump. Alternately, you can use the --lcore start-up option
to debug a core file created by a forced core dump.
Saving the Core File to a Specific File Name
You can specify a <corefile-name> as an option in the dumpcore command. This
saves the dumped core file in the specified file, <corefile-name>, instead of
core.<pid>.
To specify the filename as an option in the dumpcore command, enter the following
command at the gdb prompt:
(gdb) dumpcore <corefile-name>
24