Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)

14.26.1.3 Java corefile debugging support
HP WDB shows stack traces of mixed Java, C, and C++ programs for java corefile.
GDB_JAVA_UNWINDLIB environment variable must be set to the path name of the Java unwind
library as explained above.
Following are examples that illustrate the gdb command-line options for invoking gdb on a core
file:
1. Invoke gdb on a core file generated when running a 32-bit Java application on an Integrity
system with /opt/java1.4/bin/java:
$ gdb /opt/java1.4/bin/IA64N/java core.java
2. Invoke gdb on a core file generated when running a 64-bit Java application on an Integrity
system with /opt/java1.4/bin/java -d64:
$ gdb /opt/java1.4/bin/IA64W/java core.java
3. Invoke gdb on a core file generated when running a 32-bit Java application on PA-RISC using
/opt/java1.4/bin/java:
$ gdb /opt/java1.4/bin/PA_RISC2.0/java core.java
4. Invoke gdb on a core file generated when running a 64-bit Java application on PA-RISC using
/opt/java1.4/bin/java:
$ gdb /opt/java1.4/bin/PA_RISC2.0W/java core.java
When debugging a core file, it is good practice to rename the file from core to another name to
avoid accidentally overwriting it.
If the Java and system libraries used by the failed application reside in non-standard locations,
then the GDB_SHLIB_PATH environment variable must be set to specify the location of the libraries.
14.26.1.4 Java attach mode debugging support
HP WDB supports java debugging in attach mode also. GDB_JAVA_UNWINDLIB environment
variable must be set to the path name of the Java unwind library. From gdb version 5.6 and later
versions, GDB JAVA UNWINDLIB environment variable need not be set to the path name of the
Java unwind library. HP WDB uses the libjunwind.sl specified by the Java Virtual Machine.
The following examples illustrate how to invoke gdb on a hung process:
1. Determine the process id:
$ ps -u user1 | grep java
23989 pts/9 8:52 java
2. Attach gdb to the running process:
$ gdb -p 23989
HP gdb 5.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.0 (based on GDB) is covered by the
GNU General Public License.Type "show copying" to see the con-
ditions to
change it and/or distribute copies. Type "show warranty" for
warranty/support.
Reading symbols from /opt/java1.4/bin/IA64N/java...
(no debugging symbols found)...done.
Attaching to program: /opt/java1.4/bin/IA64N/java, process 23989
(no debugging symbols found)...
Reading symbols from /usr/lib/hpux32/libpthread.so.1...
(no debugging symbols found)...done.
Reading symbols from /usr/lib/hpux32/libdl.so.1...
...
174 HP-UX Configuration-Specific Information