当内存位置的内容发生变化或被读取时自动中断 [英] Automatic break when contents of a memory location changes or is read
问题描述
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/ARH9QATE/DOCU_009.HTM
有没有办法在VisualStudio调试器中做这样的事情?还是有一个附加功能或其他可以在Windows下执行的工具?
是的,你可以这样做视觉工作室。在正在运行的程序中,您可以在调试菜单下创建一个新数据断点。然后指定要观看的地址和字节数。
这仅适用于更改值。我不知道如何观看阅读权限。然而,这是一个很常见的问题,想知道价值在哪里变化。我发现我不想知道谁经常读一个价值。
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
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屋!