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只对全局变量设置

clip_image002.jpg

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 年后的这一周,都跟家人在一起。时过得真快,今天到了上班的日子,却有些小欣喜。 首先每日的早起让上班竟毫无压力感、焦...
    小茹老师阅读 206评论 0 0
  • 思维导图 第一节 概述 你来这里说明你遇到了挑战,或者想进一步提高自己的能力。 入门篇,学习的作用。 基础...
    老江的世界阅读 4,165评论 0 19