NonStop Server for Java 7.0 Tools Reference Pages

If the current thread is suspended (either through an event such as a breakpoint or through the
suspend command), local variables and fields can be displayed with theprint anddump
commands. The up and down commands select which stack frame is current.
Breakpoints
Breakpoints can be set in jdb at line numbers or at the first instruction of a method, for example:
stop at MyClass:22 (sets a breakpoint at the first instruction for line 22 of the source file
containing MyClass)
stop in java.lang.String.length (sets a breakpoint at the beginning of the method
java.lang.String.length)
stop in MyClass.init (init identifies the MyClass constructor)
stop in MyClass.clinit(clinit identifies the static initialization code for MyClass)
If a method is overloaded, you must also specify its argument types so that the proper method can
be selected for a breakpoint. For example, MyClass.myMethod(int,java.lang.String),
or MyClass.myMethod().
The clear command removes breakpoints by using a syntax as in clear MyClass:45. Using the
clear command with no argument displays a list of all breakpoints currently set. The cont command
continues execution.
Stepping
The step command advances execution to the next line whether it is in the current stack frame or
a called method. The next command advances execution to the next line in the current stack
frame.
Exceptions
When an exception occurs for which there is not a catch statement anywhere in the throwing
thread's call stack, the Java VM normally prints an exception trace and exits. When running under
jdb, however, control returns to jdb at the offending throw. You can then use jdb to diagnose
the cause of the exception.
Use the catch command to cause the debugged application to stop at other thrown exceptions,
for example: catch java.io.FileNotFoundException or catch
mypackage.BigTroubleException. Any exception that is an instance of the specified class
(or of a subclass) stops the application at the point where it is thrown.
The ignore command negates the effect of a previous catch command.
NOTE: The ignore does not cause the debugged VM to ignore specific exceptions, only the
debugger.
Command Line Options
When you use jdb in place of the Java application launcher on the command line, jdb accepts
many of the same options as the “java: Java Application Launcher” (page 18) command, including
-D, -classpath, and -Xoption.
The following additional options are accepted by jdb:
-help
Displays a help message.
-sourcepath directory1 [:directory2]...
Uses the given path in searching for source files in the specified path. If this option is not specified,
the default path of "." is used.
Breakpoints 31