Can I trust local variable value when analyzing a dump with Windbg?

北慕城南 提交于 2019-12-11 07:25:39

问题


I see strange things like a pointer values changing the values (0 or something valid) between 2 calls with no change. Same with a enum values. The values are simply forwarded, no chances to be modified. The dump is minidunp.


回答1:


You can use dv /V to reveal if a local variable is living in a register. Like here:

0:000> dv /v @ecx this = 0x0018fe10

To get rid of this, you must remove optimization when compiling.




回答2:


Optimized build I assume? The problem is that the CPU doesn't deal in variables, but works with memory addresses and registers. As it happens, in release builds one register may be shared by many variables - not all at the same time, of course. But if the debugger can't work out what variable is now in the register, it may get quite confused.



来源:https://stackoverflow.com/questions/7877383/can-i-trust-local-variable-value-when-analyzing-a-dump-with-windbg

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