views:

603

answers:

3

How do I see a disassembly of the machine code generated by the .net JITer? The Show disassembly window menu option is no where to be found. Even the tool bar button for it is in the disabled state. If I recall correctly the disassembly can indeed be seen but one must resort to some trick, unfortunately I don't remember what that trick was. Can someone please provide some pointers here?

Debugging environment: VS2008 (I guess you can see the disassembly without much pain in WinDbg and some debugger extention (SOS.dll?) Hmm, now I think that same dll may also be used in VS2008 let me check and get back to you. Please feel free to correct me if I am wrong.)

A: 

The Disassembly window is working fine for me in a C# project in VS2008 Team System Developer Edition.

Actually - there's one thing that's not working as I would have hoped - I can't step into Framework code. Maybe there's some setting somewhere that might let me do that, I don't know. But I can step throiugh the disassembly for my own code just fine.

Are you using VS2008 Express? Maybe that has some limitation.

There's always cordbg (yikes!).

Of course, the JITer will generate non-optimized code when run under a debugger. There may be some hoops you can jump through to avoid this - like attaching to the process after the JIT has done its work for whatever you want to look at.

Michael Burr
Hi Michael, I am using VS2008 professional edition (along with Resharper 4.5).
SDX2000
VS2008 pro should be just fine.
__grover
A: 

Hi unfortunately the show debug window command is still not working but you can get by with a debugger extention dll called SOS.dll to debug/disassemble .net code here are a few links (note this works with VS2008 and WinDbg)...

1) MSDN: SOS Debugging Extension (SOS.dll)
2) Some general tips on using SOS with Windbg

SDX2000
A: 

Seems to be working fine for me. Do you have Address Level debugging enabled? Tools | Options | Debugging | General | Enable Address Level Debugging?

To get the dissassembly window, go to Debug | Windows | Dissassembly (I'm using the c# developer profile)

Or, in the Command Window, type Debug.Dissassembly

JMarsch