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.
TIA
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.
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.
Ah, thank you for clarification. So the x86 code doesn't come directly from the compiler, instead the debugger gets it back from the CLR?
Is there any reason to see also MSIL at debugging time?
No. Actually, I prefer x86, as I understand that, as opposed to MSIL.
you can use ILDASM or Reflector.
I already had a look at ILDASM. It reveals a real lot of information of which I only understand a minority so far. I think I'll delve deeper into that matter later, when I really need it.
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).
Bookmarks