Creating Breakpoints
See Also
Creating breakpoints is done using the New Breakpoint dialog box.
You can open the dialog box by choosing Breakpoint > New
Breakpoint from the menu bar.
There are several types of breakpoints that can be created, which
are described below.
- Class
- Stops when a class matching a given pattern loads or unloads.
Since a class may be loaded by multiple class loaders, this may be
hit more than once.
- Exception
- Stops when an exception matching a given pattern is thrown and
caught or not caught. In Java 5.0, uncaught exceptions are
difficult to detect and thus this type of breakpoint may not always
stop when expected.
- Line
- Stops when a particular line of code in a source file is
reached. This can only be created by clicking on a line in the
source viewer.
- Method
- Stops when a particular method in a class matching a given
pattern is reached. Note that setting method breakpoints in
either the instance initializer or constructors is not entirely
reliable. The Sun JPDA implementation does not properly distinquish
between the two, so breakpoints in either may, or may not, actually
stop as expected. Use line breakpoints instead.
- Thread
- Stops when a thread matching a given pattern is started or
dies.
- Trace
- Never stops, only shows a brief message in the Output window
when any method is entered and exited. Produces copious amounts of
output.
- Variable
- Stops when a specific field in a class is accessed or
modified.
Breakpoints support optional actions that are performed when the
breakpoint stops. These are called monitors, and you can learn more
about the available monitors in the Breakpoint
Monitors topic.
See Also
Legal Notices