The debugging session
To initiate a debugging session:
- Set a breakpoint and then choose Debug | Start Debugging from the Main Window (or press F5). (If you are debugging a GUI application or another looped application, it is not necessary to set a breakpoint before starting.)
By default, the IDE switches to the Debugging Workspace (to configure it to do otherwise, see Customizing workspaces), where the Debugger Window, the Editor with the source being debugged, and the Output Window all open up. The Output Window is split vertically, with Debugger output on the right and any output from the application being debugged on the left. When the Debugger reaches a breakpoint in your source, that breakpoint is highlighted pink. The pink line will move through your source as you code as you step through its execution.
Debugging can also be initiated by choosing the Trace Into command, which causes the Debugger to stop on the first line after the main method.
- Once execution has halted (whether on a breakpoint or just after the main method), use the Trace Into, Go To Cursor, Trace Over, Trace Out, and/or Continue menu or toolbar items under the Main Window Debug menu (or the keyboard shortcuts F7, F8, CTRL+F7, and F5, respectively) to proceed.
Trace Into steps into the method at which the Debugger is currently stopped if there is a method call on that line and breaks at the start of the called method, enabling you to observe execution incrementally. If there is no method call on the current line, then it behaves like Trace Over.
Go To Cursor executes the current statement and all ensuing statements until it reaches the line that the insertion point is on.
Trace Over executes the current statement without breaking and stops at the next statement.
Trace Out halts execution after the current method finishes and control passes to the caller.
Continue resumes execution, which continues until it reaches the next breakpoint or the end of the application.
By stepping through your code like this, you can monitor whatever parts of the system you choose during execution of the code.
Contents | Prev | Next | Index |