Here are some other things can do with breakpoints:
· Set a conditional breakpoint(條件斷點(diǎn)):
(1)右鍵斷點(diǎn)標(biāo)記出現(xiàn)菜單Right-click on a breakpoint marker to bring up a contextual menu,and
(2)選擇斷點(diǎn)屬性(breakpoint properties)choose Breakpoint Properties to display a properties dialog box
(3)選擇(common)Click the Common option in the left panel and
(4)編輯條件表達(dá)式enter a C/XC conditional expression in the Condition text box in the right panel. (條件表達(dá)式可以包含斷點(diǎn)范圍內(nèi)的任意變量)The expression can contain any variables in the scope of the breakpoint.
· Set a watch point on a global variable(全局變量的watch point):
A watch point is a special breakpoint that suspends execution whenever the value of an expression changes(without specifying where it might happen).
(1)右鍵Breakpoint view區(qū)域的任意地方Right-click anywhere in the Breakpoints view and choose
(2)加上Add Watchpoint. Add Watchpoint C/XC from the contextual menu.
(3)加入表達(dá)式 Enter aC/XC expression in the dialog box, for example a[MAX].
Select Write to break when the expression is written, and Read to break when the expression is read.
1:在Debug模式下window->showwindow->Breakpoints
2:點(diǎn)擊Breakpoints view的右上角(紅圈內(nèi)的倒三角),選擇Add watchpoint
3:Select Write to break when theexpression is written, and Read to break when the expression is read.注意watchpoint只對(duì)全局變量設(shè)置眶明。