当内存位置的内容更改或读取时自动中断 [英] Automatic break when contents of a memory location changes or is read
问题描述
旧的DEC Tru64 UNIX调试器具有一个功能(称为监视变量的观察点),该功能将监视读取或写入活动的内存位置(或地址范围),并在检测到此类活动时破坏程序,可以调查为什么。详情请参阅:
The old DEC Tru64 UNIX debugger had a feature (called "watchpoints to monitor variables") that would watch a memory location (or range of addresses) for read or write activity and when it detected such activity would break the program so you could investigate why. See for details:
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/ARH9QATE/DOCU_009.HTM
有任何方法做这样的事情在VisualStudio调试器?
Is there any way to do this sort of thing in the VisualStudio debugger? Or is there an add-on or some other tool that can do this under Windows?
推荐答案
是的,你可以这样做视觉工作室。在正在运行的程序中断开时,可以在调试菜单下创建新数据断点。然后指定要观看的地址和字节数。
Yeah, you can do this in visual studio. You can create a "New Data Breakpoint" under the debug menu while you're broken in a running program. You then specify the address to watch and the number of bytes.
这只适用于更改值。我不知道如何观看读取访问。然而,这是一个很常见的问题,想知道一个值发生了什么变化。我发现我不想知道谁经常读取值。
This only works for changing the value. I don't know how to watch for read access. However it's a very common question to want to know where a value got changed. I find that I don't want to know who reads a value as often.
这篇关于当内存位置的内容更改或读取时自动中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!