Debugging: 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 behaviour. Like a video editing session, the program can be executed in slow motion with the ability to go forward, pause, stop, and so on.

The methods that can be used to execute a program in the debugger are described in the next few sections.

Single stepping (step in)

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, it is possible to study the various program parameters.

If the program has not been started at the time single stepping is started, the program will be started and will be stopped at the first statement of the program (the first statement in the function main()).

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