Share via


Running to a Location

Home Page (Debugger)OverviewHow Do I... Topics

What do you want to do?

Run until a breakpoint is reached

Run to the cursor

Run to the cursor location in object code

Run to the cursor location in the call stack

Run to a specified function

Set the next statement to execute

Set the next disassembled instruction to execute

To run until a breakpoint is reached

  1. Set a breakpoint.

  2. On the Build menu, click Start Debug.

  3. From the Start Debug menu, choose Go.

To run to the cursor (while the debugger is not running)

  1. In a source file, move the insertion point to the location where you want the debugger to break.

  2. From the Build menu, select Start Debug and Run To Cursor.

To run to the cursor (while the debugger is running but halted)

  1. In a source file, move the insertion point to the location where you want the debugger to break.

  2. From the Debug menu, choose Run To Cursor.

To run to the cursor location in disassembly code (while the debugger is running but halted)

  1. In the Disassembly window, move the insertion point to the location where you want the debugger to break.

  2. On the Debug menu, click Run To Cursor.

To run to the cursor location in the call stackcode (while the debugger is running but halted)

  1. In the Call Stack window, select the function name.

  2. From the Debug menu, choose Run To Cursor.

To run to a specified function

  1. In the Find box on the standard toolbar, type the function name.

  2. On the Build menu, click Start Debug.

  3. On the Start Debug menu, click Run To Cursor.

Tip   You can use the Run To Cursor command to return to an earlier statement to retest your application, using different values for variables.

To set the next statement to execute (while the debugger is running but halted)

  1. In a source window, move the insertion point to the statement or instruction that you want to execute next.

  2. Click the right mouse button.

  3. On the shortcut menu, click Set Next Statement.

To set the next disassembled instruction to execute (while the debugger is running but halted)

  1. In the Disassembly window, move the insertion point to the disassembled instruction you want to execute next.

  2. Click the right mouse button.

  3. On the shortcut menu, click Set Next Statement.

Tip   You can use the Set Next Statement command to skip a section of code. For instance, a section that contains a known bug — and continue debugging other sections.

Caution   The Set Next Statement command causes the program counter to jump to the new location. The intervening code is not executed. Use this command with caution.