Setting Breakpoints
Home Page (Debugger) | Overview | How Do I... Topics
Use the Breakpoints dialog box (accessed by the Breakpoints command on the Edit menu), to set, remove, disable, enable, or view breakpoints. The breakpoints you set will be saved as a part of your project.
Note You must have a project open before you can set a breakpoint. With no project open, the Breakpoints command does not appear on the Edit menu.
You can set breakpoints on a source-code line or in the Disassembly or Call Stack window.
What do you want to do?
Set a breakpoint at a source-code line
Set a breakpoint at the beginning of a function
Set a breakpoint at the return point of a function
Set a breakpoint at a label
To set a breakpoint at a source-code line
In a source window, move the insertion point to the line where you want the program to break.
Choose the Insert/Remove Breakpoint toolbar button.
A red dot appears in the left margin, indicating that the breakpoint is set.
Note If you want to set a breakpoint on a source statement extending across two or more lines, you must set the breakpoint on the last line of the statement.
To set a breakpoint at the beginning of a function
In the Find box on the Standard toolbar type the function name.
Click the Insert/Remove Breakpoint toolbar button.
While in debug mode a red dot appears in your source code in the left margin at the beginning of the function, indicating that the breakpoint is set.
To set a breakpoint at the return point of a function
Start debugging, and pause the debugger in break mode (program is waiting for user input after completing a debugging command).
On the View menu, click Debug Windows, then click Call Stack.
In the Call Stack window, move the insertion point to the function where you want the program to break.
Click the Insert/Remove Breakpoint toolbar button.
While in debug mode a red dot appears in the left margin of your source code, indicating that the breakpoint is set.
To set a breakpoint at a label
In the Find box on the Standard toolbar type the name of the label.
Click the Insert/Remove Breakpoint toolbar button.
While in debug mode a red dot appears in your source code, in the left margin at the line containing the label, indicating that the breakpoint is set.