15.4.2 Single-Stepping

In single-stepping, CodeView pauses after each line of code is executed. The next line to be executed is highlighted.

Summary: There are two ways to single-step.

You can single-step through a program with the Step and Trace commands. Step (executed by pressing F10) steps over procedure calls. All the code in the procedure is executed, but it appears to you as if the procedure executed in a single step. Trace (executed by pressing F8) traces through every step of all procedures. Each line of the procedure is executed as a separate step.

You can alternate between Trace and Step as you like. The method you use depends only on whether you want to see what happens within a particular procedure. (Note that interrupt calls are always stepped over; you do not see individual steps of the execution.)

If CodeView cannot locate the source code for a procedure in the current directory, it pauses and asks for the name of the file that contains the source. If you cannot supply a source file, CodeView disassembles the executable code and displays that instead. (If you are executing in Source mode, and the source code for a procedure is not available, CodeView steps over the procedure, even if you use the Trace command.)

Note that breakpoints are active during both step and trace mode. If the procedure you step over contains a breakpoint, execution stops at the breakpoint.

You can trace through the program continuously (without having to press F8 at each step), using the Animate command from the Run menu. The speed of execution is controlled by the Trace Speed command from the Options menu. You can halt animated execution at any time by pressing any key.