
However, control returns to jdb at the offending throw. When an exception occurs for which there isn't a catch statementĪnywhere in the throwing thread's call stack, the VM normally Next command advances execution to the next line in the Whether it is in the current stack frame or a called method. The step commands advances execution to the next line Using the clear orĬommand with no argument displays a list of all breakpointsĬurrently set. The clear command removes breakpoints using a syntax as Types so that the proper method can be selected for a breakpoint.įor example, " M圜lass.myMethod(int,)", or If a method is overloaded, you must also specify its argument
COMPILING JAVA IN TERMINAL SUBCLASS CODE
Identifies the static initialization code for M圜lass) Instruction for line 22 of the source file containing


where threadindex dumps the stack of the specified thread. where where with no arguments dumps the stack of theĬurrent thread. Is specified with the thread index described in the Many jdbĬommands are based on the setting of the current thread. Running, thread Select a thread to be the current thread. Of, the thread name is "main", and it is currently In this example, the thread index is 4, the thread is an instance Its name and current status are printed, as well as an index thatĬan be used for other commands, for example: threads List the threads that are currently running. The dump command supports the same set of expressionsĪs the print command. For objects, it prints the current value of eachįield defined in the object.

For information on starting a J2SE 1.4.2 or The Java Platform DebuggerĪrchitecture has additional documentation on theseĬonnection options. There are many other ways to connect the debugger to a VM, andĪll of them are supported by jdb. In this case because jdb is connecting to an existing VM Note that "M圜lass" is not specified in the jdb command line You can then attach jdb to the VM with the following agentlib:jdwp=transport=dt_shmem,server=y,suspend=nįor example, the following command will run the M圜lassĪpplication, and allow jdb to connect to it at a laterĬ:\> java -agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n M圜lass Options load in-process debugging libraries and specify the kind of Jdb must be started with the following options. VM before executing that class's first instruction.Īnother way to use jdb is by attaching it to a Java VM When started this way, jdb invokes a second Java VM withĪny specified parameters, loads the specified class, and stops the M圜lass, you use the following command to debug it under JDB:

For example, if your application's main class is This isĭone by substituting the command jdb for java in theĬommand line. (VM) with the main class of the application to be debugged. Used way is to have jdb launch a new Java Virtual Machine There are many ways to start a jdb session. It is a demonstration of the Java Platform DebuggerĪrchitecture that provides inspection and debugging of a local The Java Debugger, jdb, is a simple command-line debuggerįor Java classes. arguments Arguments passed to the main() method of class Name of the class to begin debugging. Options Command-line options, as specified below. Jdb - The Java Debugger jdb helps you find and fix bugs in Java language programs.
