Next: , Previous: Debugging Overview, Up: Debugging Your Project


6.6.6.2 Running Your Project In The Debugger
resources/debug-toolbar-1.png

Debugger States

There are three states the debugger can be in: Stopped, Paused, and Running. While you are editing your source code, the debugger is in the Stopped state. If you are running the program in the debugger, it will be in the Running state. If the debugger hits an error, a Breakpoint, or you Pause the program then the debugger will be in the Paused state.

Note that you cannot edit your source code while the debugger is in the Paused or Running states. You must Reset the debugger first (see below) before editing your code again.

Run and Pause

You can execute the program in the debugger by clicking Debug Run in the debug toolbar, or Debug -> Run from the main menu.

If you have set a breakpoint or are receiving an error, you can Run the program in the debugger so that it continues execution at full speed until it reaches the breakpoint or the error. At that point the debugger enters the Paused state and allows you to begin Stepping.

If a program is running you can also enter the Paused state by clicking Pause in the Debug Toolbar or Debug -> Program Pause from the main menu.

Paused Mode and Stepping

Once the debugger is Paused you can examine the state of the program at the current execution point. The source line that will be executed next will be highlighted in blue.

There are two ways to execute the next source line: Step Into and Step Over. Step Into will trace into any functions that are called on that source line (if possible). Step Over will execute the current source line without going into any functions that are called.

While the program is Paused you can view Local Variables and the Call Stack.

To continue running the program at full speed while in the Paused state, click the Debug Run button again. Execution will begin at the current highlighted source line.

If you wish to Reset the program so that you start running it from the beginning then click the Reset button in the debug toolbar, or Debug -> Program Reset from the main menu.

Run To Cursor

Use Run To Cursor as a convenient way of running the program in the debugger up to the line the cursor is on. Once execution reaches the specified line, the debugger will stop execution and be in the Paused state.