如何检测变量何时更改值 [英] How to detect when a variable changes value

查看:124
本文介绍了如何检测变量何时更改值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何轻松检测变量何时更改值?每当指定的变量改变值时,我希望程序的执行中断调试器。现在我正在使用Eclipse的调试器。

How can I easily detect when a variable changes value? I would like the execution of the program to break on the debugger whenever a specified variable changes value. Right now I'm using Eclipse's debugger.

推荐答案

对于类或实例变量


  1. 右键单击大纲视图中的变量

  2. 选择切换观察点

  3. 然后,在breapkoints视图中,您可以正确点击生成的
    条目

  4. 选择断点属性

  5. 取消选择现场访问。

  1. right-click on the variable in the outline view
  2. select "Toggle Watchpoint"
  3. Then, in the breapkoints view, you can right-click on the resulting entry
  4. select "breakpoint properties"
  5. deselect "Field Access".

这篇关于如何检测变量何时更改值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆