42.3. Execution Point

After reaching a breakpoint, it is often useful to be able to step through code and review both variable values and program execution. Visual Studio 2008 not only enables you to step through your code, it also permits you to adjust the execution point to backtrack or even repeat operations. The line of code that is about to be executed is highlighted and an arrow is displayed to the left, as shown in Figure 42-14.

Figure 42.14. Figure 42-14

42.3.1. Stepping Through Code

The first step in manipulating the execution point is simply to step through code in the expected order of execution. Three size increments can be used to step the debugger forward. It is important to remember that when stepping through code it is actually being run, so variable values may change as you progress through the application.

42.3.1.1. Stepping Over (F10)

Stepping Over is fully executing the line that currently has focus and progressing to the next line in the current code block. If the end of the code block has been reached, stepping returns to the calling code block.

42.3.1.2. Stepping In (F11)

Stepping In behaves the same as Stepping Over when the line is a simple operator, such as a numeric operation or a cast. When the line is more complex, Stepping In steps through all user code. For example, in the following code snippet, pressing F10 through the TestMethod only steps ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.