Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
java jvm-state -- Show Java virtual machine's current internal states
java locals -- Show the current or specified Java frame locals info
java mutex-info -- Print out details of the static mutexes
java object -- Print out the given Java object's fields info
java oop -- Find the Java object oop of the given Java heap address
java references -- Find all the references to the given Java object in the Java heap
java unwind-info -- Show the unwind info of the code where the given pc is located
java unwind-table -- Print out the dynamically generated Java Unwind Table
Type help java followed by java subcommand name for full documentation. Command name
abbreviations are allowed if unambiguous.
Java VM Debugging Commands
The following commands have been added to enhance Java debugging support:
brbacktrace Prints backtrace of mixed Java and native frames. Standard backtrace
command of GDB has been enhanced to work with mixed Java and native
stack frames.
info frame Prints Java frame specific information for a Java frame. Standard frame
command of GDB has been enhanced to interpret a Java stack frame.
info threads Prints state information for Java threads.
thread Prints detailed state information for the current Java thread.
Java subcommands
The following Java subcommands have been added:
java args <frame-number> Prints the current or specified Java frame arguments
information
java bytecodes <methodOop> Disassembles the given Java method bytecode
java heap-histogram Displays the Java heap object histogram
java instances <klassOop> Locates the instances of the given klassOop in the Java heap.
java jvm-state Prints current status of JVM internal states
java locals Prints the current or specified Java frame locals information
java mutex-info Prints details of static mutexes
java object <object-ptr> Prints the given Java object field information
java oop <Java_heap_address> Locates Java object oop of the given Java heap address
java references <oop> Locates references to the given Java object in the Java heap
java unwind-info <pc> Prints unwind information of the code where the PC is
located
java unwind-table Prints the dynamically generated Java Unwind Table
Type help java followed by the subcommand name for full documentation. Command name
abbreviations are allowed if they are unambiguous.
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
166 HP-UX Configuration-Specific Information