I'm new to .NET and C++/CLI (though not to programming in general or C++) and recently did some experiments in that environment using VC++ 2010 Express. And there's (at least ) one thing that made me wonder: Whenever I look at the dissasembly window in the debugger while debugging one of my small experimental projects compiled using /clr or even /clr:pure, I see genuine x86 code instead of MSIL (whatever that may look like).
To be honest, I was surprised to see a disassembly window for this kind of project at all. I strongly supposed managed code to be initially compiled to MSIL and then finally JIT-compiled at (or more precisely: just prior to) runtime. Was I really that wrong about that?
This is not really a problem, I'm just primarily curious.
Last edited by Eri523; August 24th, 2010 at 05:39 AM.
As you write, managed code is initially compiled to MSIL and then finally JIT-compiled. Source code is shown in the Source window, and final executable code is shown in Disassembly window. Is there any reason to see also MSIL at debugging time? Anyway, this is not supported, you can use ILDASM or Reflector.
So the x86 code doesn't come directly from the compiler, instead the debugger gets it back from the CLR?
C++/CLI compiler converts source code to MSIL. JIT compiler converts MSIL to executable code. If you open Disassembly window, debugger converts executable code back to Assembly (true Assembly, not MSIL).