14.25.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
1.Invoke gdb on a core file generated when running a
$ gdb /opt/java1.4/bin/IA64N/java core.java
2.Invoke gdb on a core file generated when running a
$ gdb /opt/java1.4/bin/IA64W/java core.java
3.Invoke gdb on a core file generated when running a
$ gdb /opt/java1.4/bin/PA_RISC2.0/java core.java
4.Invoke gdb on a core file generated when running a
$ 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
14.25.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
220