Setting the Execution Point
In the Visual Studio debugger, you can move the execution point to set the next statement of code to be executed. A yellow arrowhead in the margin of a source or Disassembly window marks the current location of the execution point. By moving the execution point, you can skip over a portion of code or return to a line previously executed. This can be useful in some situations — for example, if you want to skip a section of code that contains a known bug and continue debugging other sections.
Caution Changing the execution point causes the program counter to jump directly to the new location. Use this command with caution. Note that instructions between the old and new execution points are not executed; if you move the execution point backwards, intervening instructions are not undone; moving the execution point to another function or scope usually results in call-stack corruption, causing a run-time error or exception; and if you try moving the execution point to another scope, the debugger opens a dialog box that gives you a warning and a chance to cancel the operation. (Moving the execution point to another function or scope is not possible in Visual Basic.)
Note In managed code, you cannot change the execution point after an exception has occurred.
You cannot set the execution point while your application is actively running. To set the next statement, the debugger must be in break mode. For more information, see Breaking Execution.
To set the next statement to execute
- In a source window or Disassembly window, right-click the statement or assembly-language instruction that you want to execute next and choose Set Next Statement from the shortcut menu.
If the current execution point is in the same source file as the statement you want to set, you can move the execution point by dragging the marker arrow:
To set the next statement to execute (alternative method)
- In a source window, click the execution point marker (yellow arrowhead) and drag it to a location in the same source file where you want to set the next statement.