Debugging Core Files Using HP WDB (5900-1573; WDB 6.2; January 2011)
3. To view the current settings for this feature, run the corepid, with the following
parameter:
#<path>/corepid [stat]
The following example illustrates how to use this script on HP-UX 11i v1:
#cat /tmp/corepid
case $1 in
on) echo "core_addpid/W 1\ncore_addpid?W 1" | adb -w -k /stand/vmunix /dev/kmem;;
off) echo "core_addpid/W 0\ncore_addpid?W 0" | adb -w -k /stand/vmunix /dev/kmem;;
stat) echo "core_addpid/D\ncore_addpid?D" | adb -w -k /stand/vmunix /dev/kmem;;
*) echo "usage $0: on|off|stat";;
esac
#/tmp/corepid stat
core_addpid:
core_addpid: 0
core_addpid:
core_addpid: 0
#/tmp/corepid on
core_addpid: 0 = 1
core_addpid: 0 = 1
#/tmp/corepid stat
core_addpid:
core_addpid: 1
core_addpid:
core_addpid: 1
#/tmp/corepid off
core_addpid: 1 = 0
core_addpid: 1 = 0
Avoiding Core File Corruption for Applications Running HP-UX 11i v3
To prevent overwriting of core files from different processes for applications running in
HP-UX 11i v3, you can use the coreadm commandl.
The coreadm command enables you to specify the location and pattern for core files
that are created by abnormally terminating processes. This command can also be used
to specify the path for the core file placement. In addition, it can be used to specify the
process specific pattern for the file name of the core file.
For example, to set the global core file settings to include the process-ID and the system
name in the file name of the core, <core.pid> and to place the core file in the specified
path, <path>, you can enter the following command as a superuser at the HP-UX prompt:
# coreadm -e global -g <path>/core.%p.%n
For more information about using the coreadm command to avoid core file corruption,
see coreadm(1M)
NOTE: This feature (to prevent core file corruption) is not required for forced core-dumps.
In the case of forced core-dumps, the core files are stored in a file name, <core.pid>,
by default.
Java Corefile Debugging Support
HP WDB shows stack traces of mixed Java, C, and C++ programs for java corefile.
The GDB_JAVA_UNWINDLIB environment variable must be set to the path name of the
Java unwind library.
Java Corefile Debugging Support 35