
Set Breakpoints #36
Chapter 5, Debugging
|
147
HACK
breakpoint and click the Delete icon or delete all breakpoints in one go by
clicking the Clear All Breakpoints icon or pressing Ctrl-Shift-F9 (Debug.
ClearAllBeakpoints). From the Breakpoints window, you can disable break-
points without deleting them, either by unchecking a particular breakpoint
or by clicking the Disable All Breakpoints icon. To edit a breakpoint, select
the breakpoint and click the Properties icon, or right-click on the break-
point from this window and choose the Properties option. This will display
the Breakpoint Properties dialog, which is analogous to the New Breakpoint
dialog, but with the selected breakpoint’s values shown.
Break Only on Certain Conditions
Breakpoints in Visual Studio can be configured to cause the program to
enter break mode only when a particular condition holds. To add a condi-
tion to a breakpoint, view the breakpoint’s properties by selecting the break-
point from the Breakpoints window and clicking on the Properties icon.
From any of the tabs, you will find a button titled Condition. Clicking on
this will display the Breakpoint Condition dialog, where you can specify the
condition to be watched. Figure 5-7 shows the Breakpoint Condition dialog.
Figure 5-6. Manage breakpoints through the Breakpoints window
Figure 5-7. Add a condition to a breakpoint in Breakpoint Condition dialog