Setting Breakpoints at a Memory Location Within the Current Scope
You can use the Breakpoints dialog box to stop program execution at a particular memory location or when a specified condition occurs.
Note You can also set breakpoints outside of the current scope. For more information, see Setting Breakpoints Outside the Current Scope.
To set a breakpoint at a memory address
From the View menu, click Debug Windows and Disassembly. The Disassembly window opens.
In the Disassembly window, move the insertion point to the line where you want the program to break.
Click the Insert/Remove Breakpoint toolbar button.
A red dot appears in the left margin, indicating that the breakpoint is set.
To set a conditional breakpoint
From the Edit menu, click Breakpoints.
The Breakpoints dialog box appears.
Select the Location tab.
In the Break At text box, type the location (source line number, memory address, or function name) where you want to set the breakpoint.
Click Condition.
The Breakpoint Condition dialog box appears.
Fill in the Expression and Number Of Elements text boxes as you would for a data breakpoint.
In the Breakpoint Condition dialog box, click OK to set the condition.
In the Breakpoints dialog box, click OK to set the breakpoint.
To set a conditional breakpoint with a skip count
From the Edit menu, click Breakpoints.
The Breakpoints dialog box appears.
In the Breakpoints dialog box, select the Location tab.
In the Break At text box, type a location (source line number, memory address, or function name) where you want to set the breakpoint. .
Click Condition.
The Breakpoint Condition dialog box appears.
Fill in the Expression and Number Of Elements text boxes as you would for a data breakpoint.
Fill in the Enter The Numbers Of Times To Skip Before Stopping text box. If you want your program to break every Nth time the condition is met at the specified location, set the Enter The Numbers Of Times To Skip Before Stopping to N - 1. (The debugger skips the breakpoint the first N times.)
In the Breakpoint Condition dialog box, click OK to set the condition.
In the Breakpoints dialog box, click OK to set the breakpoint.
Note The interface does not allow you to set both Enter The Numbers Of Times To Skip Before Stopping and Number Of Elements for the same breakpoint.