Error while using .ForEach in WinDbg

房东的猫 提交于 2019-12-10 14:05:27

问题


Why am I getting a Invalid parameter poi(adr+4) when I run the following command in WinDbg while debugging a dump file?

.foreach ( adr { !dumpheap -mt 66df13d4 -short } ) { !do poi(adr+4); }

The following shows that the value of adr is getting populated just fine.

.foreach ( adr { !dumpheap -mt 66df13d4 -short } ) { .echo adr; }

I want to get the contents of a .NET string variable that is stored at the 4th offset of a System.Web.Caching.CacheEntry object.


回答1:


You need to have spaces around adr or use ${adr}. This is documented in MSDN

Note When the string Variable appears within OutCommands, it must be surrounded by spaces. If it is adjacent to any other text -- even a parenthesis -- it will not be replaced by the current token value, unless you use the ${ } (Alias Interpreter) token.



来源:https://stackoverflow.com/questions/6909135/error-while-using-foreach-in-windbg

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