什么是数据断点? [英] What are data breakpoints?

查看:398
本文介绍了什么是数据断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚知道有数据断点。我使用Visual Studio在C ++中工作了5年,我从来没有使用数据断点。

I just came to know that there are data breakpoints. I have worked for the last 5 years in C++ using Visual Studio, and I have never used data breakpoints.

有人可以点什么数据断点,什么时候使用它们和如何将它们与VS一起使用

Can someone throw some light on what data breakpoints are, when to use them and how to use them with VS?

根据我的理解,当我们想检查更改时,可以设置数据断点一个变量的值。在这种情况下,我们可以设置一个变量值的条件的数据断点。

As per my understanding we can set a data breakpoint when we want to check for changes to a variable's value. In this case, we can set a data breakpoint with a condition on the variable value.

任何其他示例?

推荐答案

定义:


数据断点允许您打破
执行时的值存储在
指定的内存位置更改。

Data breakpoints allow you to break execution when the value stored at a specified memory location changes.

从MSDN:如何:设置数据断点

如何设置内存更改断点


  1. 从Debug菜单中选择New断点并单击新建数据断点

  1. From the Debug Menu, choose New Breakpoint and click New Data Breakpoint

- 或 -

在断点窗口菜单中,单击新建下拉菜单选择新数据断点。

in the Breakpoints window Menu, click the New dropdown and choose New Data Breakpoint.

出现新建断点对话框。

输入评估为内存的内存地址或表达式 地址。例如,当变量foo的内容发生变化时,& foo会中断。

In the Address box, enter a memory address or expression that evaluates to a memory address. For example, &foo to break when the contents of variable foo change.

在字节计数框中,输入要调试器的字节数看。例如,如果输入4,调试器将会观察从& foo开始的四个字节,如果这些字节中有任何一个字节更改值,则会中断。

In the Byte Count box, enter the number of bytes you want the debugger to watch. For example, if you enter 4, the debugger will watch the four bytes starting at &foo and break if any of those bytes change value.

单击确定。

这篇关于什么是数据断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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