Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while using .ForEach in WinDbg

Tags:

windbg

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.

like image 984
Dhwanil Shah Avatar asked Aug 02 '11 08:08

Dhwanil Shah


1 Answers

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.

like image 138
John Avatar answered Oct 05 '22 23:10

John