Java Reference
In-Depth Information
figure 18-17  
Setting Breakpoints
Creating a breakpoint in the F12 Developer Tools is as simple and straightforward as it is in
Chrome, except that instead of clicking the line number, you want to click the gray area to the left
of the line number (the gutter).
Set a breakpoint on line 12. Breakpoints are denoted by a red circle in the gutter, and notice that
an entry was added in the list of breakpoints in the breakpoints subpanel (Figure 18-18). Each entry
consists of a checkbox to enable/disable the breakpoint, the filename of the source file, and the line
number the breakpoint is on (it also displays the column of that line).
adding Watches
The Watches panel lists the variables and expressions you want to watch, as well as the variables
in scope. Adding a watch is very similar to Chrome; simply click the new watch icon and type
the variable or expression you want to watch. Figure 18-19 shows a watch for the expression
counter == 1 when the debugger is paused on line 12.
Stepping through Code
At the top of the debugger window is a set of buttons that control code execution (see Figure 18-20).
The Continue option (shortcut key F5 or F8) continues code execution until either the next
breakpoint or the end of all code. The second option, Break, lets you pause execution. This is useful
if you find yourself in an infinite loop. Next are the Step Into (F11), Step Over (F10), and Step Out
(Shift+11) buttons.
 
Search WWH ::




Custom Search