Similar to this question asking the same but in VS, I'd like to ask how can I use WinDbg to view diassembly of a JITted method?
Breaking this into two parts, in both cases there's the same SomeNamespace.SomeClass.Foo()
method that I want to disassemble.
- We only have the executable
program.exe
, and want to run it via WinDbg'sOpen Executable
. - There's an already running process in which I want to inspect the same JITted method. (Say that we can't control how the process gets started)
Now from my understanding, JIT runs the first time a method is called. If this is true, in 2.
it might be the case that the method wasn't JITted yet. Is there a way to force the JIT to run on the method in that case, so that we can inspect the result?
TL;DR: How do I disassemble a JITted method with WinDbg?