diassemble managed code issue

放肆的年华 提交于 2019-11-30 16:33:58

If you want to dump IL while debugging you can use the !dumpil command from SOS. It takes a MethodDesc pointer as input, so you have to obtain that first.

One way to get the MethodDesc pointer use the !name2ee command.

So for instance if you have a method Foo in the type Bar (in assembly ClassLibrary1) use !name2ee like this

0:000> !name2ee ClassLibrary1!ClassLibrary1.Bar.Foo
Module: 001630bc (ClassLibrary1.dll)
Token: 0x06000001
MethodDesc: 00163450  <=== HERE
Name: ClassLibrary1.Bar.Foo()
JITTED Code Address: 007500f0

Following that, you can do a !dumpil 00163450 to dump the IL for method Foo like this

0:000> !dumpil 00163450
ilAddr = 73532050
IL_0000: ldstr "Foo"
IL_0005: call System.Console::WriteLine

I don't think WinDbg works at the IL level. You'd probably have to use ildasm to get an IL disassembly.

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