I'm trying to debug an assembly that has been compiled in Release mode, so all the "good stuff" like local variables are optimized away.
As a second approach, I would like to see the CIL and the .NET stack, but I don't seem to have that option in Visual Studio 2010 - I only ha开发者_JAVA百科ve the Disassembly, Registers and Memory View, which is one level lower.
Is there a way to debug CIL in Visual Studio 2010?
This is .NET 3.5 SP1 if that matters.
This is fundamental about .NET, you never execute IL. The JIT compiler translates it to machine code, the two have very little in common. You cannot see IL executing, only machine code.
Yes, all you got to have some idea what the local variable value are is the Disassembly window and the Registers window. The latter shows you what their value is when they get loaded in a CPU register. Some knowledge of x86 (or x64) assembly is required to see the correspondence between the C# and the assembly code to know what register contains what local variable. You'd have to use a Memory window to look at the stack but that's quite impractical, you need to know the value of the ebp register and the offset.
精彩评论