Java Reference
In-Depth Information
Table 13-1. The List of Debugger Actions in NetBeans
Debug Action
Shortcut
Description
Shift + F5
Finish Debugger
Ends the debugging session.
Pause
Stops all threads in the current session.
Ctrl + F5
Continue
Resumes execution of the program until the
next breakpoint.
F8
Step Over
Executes the current line and moves the
program counter to the next line in the file.
If the executed line is a call to a function, the
code in the function is also executed.
Shift + F8
Step Over Expression
Enables you to proceed through each method
call in an expression and view the input
parameters as well as resulting output values
of each method call. If there are no further
method calls, it behaves like the Step Over
action.
F7
Step Into
Executes the current line. If the line is a call to
a function and there is source available for the
called function, the program counter moves
to the declaration of the function. Otherwise,
the program counter moves to the next line in
the script.
Ctrl + F7
Step Out
Executes the rest of the code in the current
function and moves the program counter to
the line after the caller of the function. Use
this action if you have stepped into a function
that you do not need to debug anymore.
Debugging Scripts from Java Code
Debugging scripts that are called from Java code work a little differently. Just setting
breakpoints in the script file and starting a debugger or stepping into the script from Java
code does not work. You will use the Java program shown in Listing 13-2 to debug the
script shown in Listing 13-1. The Java program uses a Reader to execute the script from
the primetest.js file. However, you can also use the load() function. In Listing 13-2,
 
 
Search WWH ::




Custom Search