Visual Studio 2017-读取变量时休息
我将Visual Studio 2017用于C ++项目。当变量的值更改时,我可以设置数据断点以断裂。例如,当变量刚刚读取时,是否可以设置断点:
int x = 5;
//somewhere in the code
int y = x; //break when x is read
?
我想每次读取变量x
时都会打破。
I use Visual Studio 2017 for C++ projects. I can set a data breakpoint to break when a value of the variable is changed. Is it possible to set a breakpoint when a variable is just read, for example:
int x = 5;
//somewhere in the code
int y = x; //break when x is read
?
I would like to break every time the variable x
is read.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看此,解释了属性与字段之间的差异
不仅仅是变量创建,如果您拥有属性,则可以在getter(读取/访问的值)或setter(将值分配给)上设置一个断点
Take a look at this that explains difference between property and fields
Instead of just a variable creation, if you have a property, you would be able to set a breakpoint at EITHER the getter (value is being read/accessed) or setter (assigning a value TO)