## Stepping Over, Into, and Out of Routines

Once you've suspended a program debug session, the Debug view provides controls to walk through program code, including commands for:

- Stepping over a routine
- Stepping into a routine
- Stepping out of a routine

#### Stepping over a routine

Use the Step Over command () to execute the current statement and advance to the next statement in the source code. If the current statement is a routine call, program execution continues until reaching one of these points:

- the end of the called routine
- a breakpoint
- a watchpoint
- an eventpoint that stops execution

To step over a routine:

- Click the Step Over button () in the Debug view
- Right-click the thread in the Debug view and select Step Over from the Debug contextual menu
- Select Run > Step Over from the menu bar

The current statement or routine executes, then program execution stops.

#### Stepping into a routine

Use the Step Into command () to execute one source-code statement at a time and follow execution into a routine call.

When stepping through a program in a debug session the IDE attempts to match the program counter (PC) location in the executable with a known project source file. If there is no source file associated with the PC the debugger displays in the Debug view the current PC address of the thread (e.g. 0x6002CC11(EUSER.DLL)()) instead of the function name. At this point you can open the Disassembly view to step through the assembler code. This most commonly happens when trying to step into Symbian OS code. We recommend that you Step Return out of the OS code and back into your project to continue debugging.

- Click the Step Into button () in the Debug view
- Right-click the thread in the Debug view and select Step Into from the context menu
- Select Run > Step Into from the menu bar

After the debugger executes the source-code statement, the current-statement arrow moves to the next statement determined by these rules:

- If the executed statement did not call a routine, the current-statement arrow moves to the next statement in the source code.
- If the executed statement called a routine, the current-statement arrow moves to the first statement in the called routine.
- If the executed statement is the last statement in a called routine, the current-statement arrow moves to the statement that follows the calling routine.

#### Stepping out of a routine

Use the Step Return command () to execute the rest of the current routine and stop program execution after the routine returns to its caller. This command causes execution to return up the calling chain.

To step out of a routine:

- Click the Step Return button () in the Debug view
- Right-click the thread in the Debug view, then select Step Return from the context menu
- Select Run > Step Return from the menu bar

The current routine executes and returns to its caller, then program execution stops

#### Other references

- Debugging overview