Is it possible to watch the value of a memory location using the Visual Studio Debugger's Watch window?

心已入冬 提交于 2019-12-02 21:18:43

If you want to watch a particular memory location then you need to tell the debugger the type of the object that lives in that location. Instead of just 0x00aabbcc use (SomeType*)0x00aabbcc. Once the debugger knows the type of the memory location it will treat it just like a typed local and display values accordingly

peeyush

Check the official site answer, which works as well as the other answers given to this question :). On that page, the section "Following a Pointer Through Memory" says:

In native code applications, you can use register names as live expressions. For example, you can use the stack pointer to follow the stack.

To follow a pointer through memory

  1. In the Memory window Address box, type a pointer expression. The pointer variable must be in the current scope. Depending on the language, you might have to dereference it.

  2. Press ENTER. Now, when you use an execution command such as Step, the memory address that is displayed will automatically change as the pointer changes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!