At runtime, there actually isn't any "MSIL" stack. Even in debug mode the code that is executed is always JIT compiled. The process of JIT compiling MSIL "flattens" it from a virtual stack machine into ordinary assembly code for the platform you are running on. That means ldloc.0
might end up being translated into something like mov eax, [sp + 4]
, or even a no-op, if the value was already lying around in a register. If you want to debug the specific instruction ldloc
, then you have to look at it in the dissasembly to see what the ldoloc was translated into and where it's actually loading the data from.
The WinDbg + SoS tools (mentioned in another post) will help you to view the CPU stack, from a managed-code perspective. They won't allow you, however, to see the "MSIL" stack because there isn't one to see.