3

I followed these steps to be able to debug in the .Net framework code. This work well for some parts of the framework (for example for System.Drawing.dll), but not for other parts (clr.dll, mscoree.dll, ...).

This seems a bit strange to me since the code in these dlls was released by Microsoft (at least the parts I see in the call stack).

I am using VS2010 & .Net 4.

Did I do something wrong, or are the correct pdb files not released by Microsoft?

eli
  • 662
  • 8
  • 18

2 Answers2

2

Microsoft released a shared-source implementation of the whole common language runtime, including mscoree.dll, but this isn't the source code that goes into the real .NET framework.

On the other hand, the source code you've obtained for System.Drawing.dll etc. is the real source code to the .NET framework, but you can't get at the runtime code this way.

Here's the download for SSCLI, otherwise known as Rotor: http://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&displaylang=en

More explanation on the differences: What is the difference between SSCLI 2.0 (ROTOR) and .NET?

Community
  • 1
  • 1
Tim Robinson
  • 53,480
  • 10
  • 121
  • 138
  • I do have to code I'm interested in, I just can't use it in the debugger (meaning: step through it) and I wonder how to do that. – eli Aug 19 '10 at 14:27
  • Have you got the SSCLI source code? Since that's not the same source that was used to build the .NET framework (there's no SSCLI release for .NET 4, for instance), I wouldn't have thought it would be much use in the debugger. – Tim Robinson Aug 19 '10 at 14:40
  • I got the code here: http://referencesource.microsoft.com/netframework.aspx I guess that's not the SSCLI source – eli Aug 19 '10 at 15:16
  • Did you get C++ sources from referencesource.microsoft.com? Which link did you use? – Tim Robinson Aug 19 '10 at 15:53
  • See the link above: I downloaded .Net 4 – eli Aug 20 '10 at 05:36
  • OK, that's the one I got. It appears to be an offline copy of the framework C# sources, so it's missing the C++ code that makes up mscoree.dll. To my knowledge, the source to the official mscoree.dll build has never been released. – Tim Robinson Aug 20 '10 at 07:54
1

I think VS allows you to debug only managed libraries of the framework. If you really need to debug the unmanaged (native) code of the CLR you should use WinDBG, but this is way more complex...

munissor
  • 3,755
  • 22
  • 24
  • Visual Studio can debug managed and unmanaged code at the same time, if you enable unmanaged debugging for a managed project – Tim Robinson Aug 19 '10 at 14:27