Java Reference
In-Depth Information
information or the information doesn't correspond to the source code. In some
cases, recompiling your sources may solve the sync problem.
Removing and disabling breakpoints
You can permanently remove any breakpoint from your project by selecting its
entry in the Breakpoints panel and clicking its tab's Remove button. To tempo-
rarily disable a breakpoint without removing it, deselect the checkbox next to its
definition. You can also remove and disable individual breakpoints through their
icon by clicking and Alt+Clicking , as described earlier.
You can now use drag and drop to reposition breakpoints in your code. Grab the
breakpoint with your mouse, and drag it to its new home.
6.2.2
Working with line number breakpoints
If you've worked with other debuggers, you're already familiar with line number
breakpoints . These are the most common type of breakpoints and are a staple of
the debugging process. Quite simply, they're used to target a particular section of
code for debugging.
Breaking at a line number
Line number breakpoints are triggered when the program reaches the specified
line of source, before the line is executed. It's possible to define a line breakpoint
that is never reached during program execution, in which case it's ignored.
Setting or unsetting a line number breakpoint is easy. Bring up the source file
in question in the editor, position the cursor anywhere on the line you wish to tar-
get, and do one of the following to toggle the breakpoint on or off:
Choose Run | Toggle Line Breakpoint ( Ctrl+F8 ).
Click in the gutter area next to the line.
Once set, a line number breakpoint remains in the project until it's removed.
Note, however, that the breakpoint is assigned to the line number, not to the
code. Moving or altering the line of code moves its corresponding breakpoint,
but the breakpoint obtains an invalid status until you reload the class.
Line breakpoints can only be set on lines of code that can be executed by the
VM . Comments, declarations of fields or methods, and empty lines aren't valid
locations for line breakpoints. If one of your breakpoints is invalid, it appears
with the invalid breakpoint icon during your debugging session and is ignored.
 
 
 
 
 
 
 
Search WWH ::




Custom Search