JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.2: Debugging a Program With dbx
search filter icon
search icon

Document Information

Preface

1.  Getting Started With dbx

2.  Starting dbx

3.  Customizing dbx

4.  Viewing and Navigating To Code

5.  Controlling Program Execution

6.  Setting Breakpoints and Traces

7.  Using the Call Stack

8.  Evaluating and Displaying Data

9.  Using Runtime Checking

10.  Fixing and Continuing

11.  Debugging Multithreaded Applications

12.  Debugging Child Processes

13.  Debugging OpenMP Programs

14.  Working With Signals

15.  Debugging C++ With dbx

16.  Debugging Fortran Using dbx

17.  Debugging a Java Application With dbx

Using dbx With Java Code

Capabilities of dbx With Java Code

Limitations of dbx With Java Code

Environment Variables for Java Debugging

Starting to Debug a Java Application

Debugging a Class File

Debugging a JAR File

Debugging a Java Application That Has a Wrapper

Attaching dbx to a Running Java Application

Debugging a C Application or C++ Application That Embeds a Java Application

Passing Arguments to the JVM Software

Specifying the Location of Your Java Source Files

Specifying the Location of Your C Source Files or C++ Source Files

Specifying a Path for Class Files That Use Custom Class Loaders

Setting Breakpoints on Java Methods

Setting Breakpoints in Native (JNI) Code

Customizing Startup of the JVM Software

Specifying a Path Name for the JVM Software

Passing Run Arguments to the JVM Software

Specifying a Custom Wrapper for Your Java Application

Using a Custom Wrapper That Accepts Command-Line Options

Using a Custom Wrapper That Does Not Accept Command-Line Options

Specifying 64-bit JVM Software

dbx Modes for Debugging Java Code

Switching from Java or JNI Mode to Native Mode

Switching Modes When You Interrupt Execution

Using dbx Commands in Java Mode

The Java Expression Evaluation in dbx Commands

Static and Dynamic Information Used by dbx Commands

Commands With Identical Syntax and Functionality in Java Mode and Native Mode

Commands With Different Syntax in Java Mode

Commands Valid Only in Java Mode

18.  Debugging at the Machine-Instruction Level

19.  Using dbx With the Korn Shell

20.  Debugging Shared Libraries

A.  Modifying a Program State

B.  Event Management

C.  Command Reference

Index

dbx Modes for Debugging Java Code

When debugging a Java application, dbx is in one of three modes:

When dbx is Java mode or JNI (Java Native Interface) mode, you can inspect the state of your Java application, including JNI code, and control execution of the code. When dbx is in native mode, you can inspect the state of your C or C++ JNI code. The current mode (java, jni, native) is stored in the environment variable jdbx_mode.

In Java mode, you interact with dbx using Java syntax and dbx uses Java syntax to present information to you. This mode is used for debugging pure Java code, or the Java code in an application that is a mixture of Java code and C JNI code or C++ JNI code.

In JNI mode, dbx commands use native syntax and affect native code, but the output of commands shows Java-related status as well as native status, so JNI mode is a “mixed” mode. This mode is used for debugging the native parts of an application that is a mixture of Java code and C JNI code or C++ JNI code.

In native mode, dbx commands affect only a native program, and all Java-related features are disabled. This mode is used for debugging non-Java related programs.

As you execute your Java application, dbx switches automatically between Java mode and JNI mode as appropriate. For example, when it encounters a Java breakpoint, dbx switches into Java mode, and when you step from Java code into JNI code, it switches into JNI mode.

Switching from Java or JNI Mode to Native Mode

dbx does not switch automatically into native mode. You can switch explicitly from Java or JNI Mode to native mode with the joff command, and from native mode to Java mode with the jon command.

Switching Modes When You Interrupt Execution

If you interrupt execution of your Java application (for example, with a control-C), dbx tries to set the mode automatically to Java/JNI mode by bringing the application to a safe state and suspending all threads.

If dbx cannot suspend the application and switch to Java/JNI mode, dbx switches to native mode. You can then use the jon command to switch to Java mode so that you inspect the state of the program.