CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    [RESOLVED] Why don't I see MSIL here?

    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.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Why don't I see MSIL here?

    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.

  3. #3
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Why don't I see MSIL here?

    Quote Originally Posted by Alex F View Post
    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.

  4. #4
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Why don't I see MSIL here?

    Quote Originally Posted by Eri523 View Post
    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).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured