20151208-4:条件断点和全局变量的watchpoint的设置

Here are some other things can do with breakpoints:

· Set a conditional breakpoint(条件断点):

(1)右键断点标记出现菜单Right-click on a breakpoint marker to bring up a contextual menu,and
(2)选择断点属性(breakpoint properties)choose Breakpoint Properties to display a properties dialog box
(3)选择(common)Click the Common option in the left panel and
(4)编辑条件表达式enter a C/XC conditional expression in the Condition text box in the right panel. (条件表达式可以包含断点范围内的任意变量)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区域的任意地方Right-click anywhere in the Breakpoints view and choose
(2)加上Add Watchpoint. Add Watchpoint C/XC from the contextual menu.
(3)加入表达式 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:点击Breakpoints view的右上角(红圈内的倒三角),选择Add watchpoint
3:Select Write to break when theexpression is written, and Read to break when the expression is read.注意watchpoint只对全局变量设置

20151208-4:条件断点和全局变量的watchpoint的设置_第1张图片
clip_image002.jpg

你可能感兴趣的:(20151208-4:条件断点和全局变量的watchpoint的设置)