- Breakpoint management: Breakpoints allow you to stop code execution at specific points within the source code. You can set and clear breakpoints within the tool, allowing you to easily control program flow while debugging. Double-clicking breakpoints opens its corresponding file with the breakpoint line highlighted.
- Call stack inspection: This feature provides a peek at what is being called when a script runs. Double-clicking an item in the call stack opens its containing file and highlights the line corresponding to the entry in the call stack.
- Variable/object inspection: This feature allows you to view the values of variables and objects during script execution.
The views of the call stack, open files, and variables/objects are presented as trees. Any item with a twisty icon next to it contains children and is expandable to view its child objects. The toolbar contains buttons for working with the basic debugging features, which include the following:
- Stop: Halts the execution of the current script. It is only active and available when a script is running.
- Continue: Allows you to resume script execution once it has been stopped via a breakpoint.
- Step Over: Allows you to step over a function call. It is available when stepping through a script line-by-line, and it allows you to skip going into a function’s code when it is called. The call to the function proceeds, and you proceed to the line following the function call.
- Step Into: Runs one statement at a time. After stepping through a statement, you can see its effect in the other debugging windows. Also, this allows you to step into the body of a function when/if it is called.
- Step Out: Executes the rest of the current function, with execution stopping at the line that called it. (This is only when Step Into is used and execution moves to a called function.)
- Profile: Enables or disables code profiling of the currently running script.
The following code contains a portion of sample data collected via the profiling feature. It includes the source file name along with the window of execution time, the name of the function used including line numbers in source code, the total calls to the function during execution, and the total time of execution.
prototype.js: 750 - 2500 milliseconds
Function Name: [from] (Lines 489 - 498)
Total Calls: 2 (max recurse 0)
Total Time: 2359.38 (min/max/avg 0/2359.38/1179.69)
Time (ex. calls): 2359.38 (min/max/avg 0/2359.38/1179.69)
The profiling data allows you to spot code and functions that may adversely affect code performance.
Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.
Check out the Web Development Zone archive, and catch up on the most recent editions of Tony Patton’s column.
Get weekly development tips in your inbox
Keep your developer skills sharp by signing up for TechRepublic’s free Web Development Zone newsletter, delivered each Tuesday. Automatically subscribe today!