Execution

Execution of a program in the debugger can be finely controlled. The program can be executed in single steps, or allowed to continue until it encounters a breakpoint. Executing like this is essential for tracking program behavior. Like a video editing session, the program can be executed in slow motion with the ability to go forward, pause, stop, and so on. You cannot go backward yet though.

The methods those can be used to execute a program in the debugger are described in the following sections. These commands are available only when the program has already been started.

6.2.1. Single stepping (step in)

Choose the menu item Debug ▸ Step In or click on the Step In icon in the Debug toolbar to step into a program.

Single stepping executes only one statement of the program (from the place where it has stopped) and then returns control. If the statement that is executed contains one or more functions, the debugger tries to step inside the functions (in the sequence in which the functions are executed). Once the statement is executed and control is passed back, you can study your program's state.

If the Disassembly window has the focus when this command is selected, it executes only one assembler instruction.

6.2.2. Single stepping (step over)

Choose the menu item Debug ▸ Step Over or click on the Step Over icon in the Debug toolbar to step over statements in a program.

Step over is similar to step in, except that it does not step inside any function in the statement being executed. The statement will be executed in one go.

If the Disassembly window has the focus when this command is selected, it executes one assembler instruction but does not stop inside if this instruction is a call to a subroutine.

If a dynamic library is loaded during the step, the program will not stop at the end of the step. But it will run until it finds a breakpoint or you stop it.

6.2.3. Single stepping (step out)

Choose the menu item Debug ▸ Step Out or click on the Step Out icon in the Debug toolbar to step out in a program.

Step out will execute the current function until it returns. The program will be stopped once it exits from the function. Step out is not really single stepping, because it does not only execute a single statement — it executes the whole function until that function returns to the calling function.

6.2.4. Run/Continue

Choose the menu item Debug ▸ Run/Continue or click on the Run/Continue icon in the Debug toolbar to continue the execution of a program.

This option continues the execution of the program until a breakpoint is encountered, or the program exits.

6.2.5. Run To

Choose the menu item Debug ▸ Run to Cursor or click on the Run to Cursor icon in the Debug toolbar to run until the line at the cursor is reached.

This option continues the execution of the program until the line or the address (if the Disassembly window has the focus) at the cursor is reached.

6.2.6. Stop Program

While the program is running and has control, no debugging tasks can be performed. To obtain control while the program is running, choose the menu item Debug ▸ Pause Program or click on the Pause Program icon in the Debug toolbar. This will interrupt the program and return control to the debugger.