Using Stepping Commands
While different programs have different requirements, the most common stepping mode is to set group focus to Control and the target to Process or Group. You can now select stepping commands from the Process or Group menus or use commands in the toolbar.
Figure 85 illustrates stepping commands.
The arrow indicates that the PC is at line 15. The four stepping commands do the following:
• Next executes line 15. After stepping, the PC is at line 16.
• Step moves into the sub2() function. The PC is at line 21.
• Run To executes all lines until the PC reaches the selected line, which is line 23.
• Out executes all statements within sub1() and exits from the function. The PC is at line 9. If you now execute a Step command, TotalView steps into sub3().
Remember the following things about single-stepping commands:
• If your program reaches a breakpoint while stepping over a function, TotalView cancels the operation and your program stops at the breakpoint.
• If you enter a source-line stepping command and the primary thread is executing in a function that has no source-line information, TotalView performs an assembler-level stepping command.
• When TotalView steps through your code, it steps one line at a time. This means that if you have more than one statement on a line, a step instruction executes all of the instructions on that line.