This is a mirror of official site: http://jasper-net.blogspot.com/

Debugging .NET 4.0 applications using SOS extension

| Tuesday, February 8, 2011
The SOS (Son of Strike) debugger extension  is an invaluable resource for debugging .NET 4.0 managed applications using native debuggers.The SOS extension lets you view information about code that is running inside the CLR. When you install .NET on your machine, the SOS.dll debugger extension gets installed too. Moreover every version of CLR ships with a new  SOS.dll so that the DLL can take advantage of the new capabilities of the CLR.

The location of the SOS.dll on my machine with .NET framework 4.0 installed is:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\SOS.dll

Here are a couple of exciting things you can do using the with latest SOS Debugger extension

  • detect object corruption
  • detect memory leaks
  • detect cross-generation references
  • find apartment model for each thread
  • find out which generation your object currently belongs to
  • breakdown of each generation with a view of managed heap size and free space
  • set managed code breakpoints
  • find the application domain of your object
and much much more as described over here

Note: If you have been using SOS in previous versions of .NET, remember that SOS in .NET 4.0 supports DML (Debugger Markup Language) now! Also note that with CLR 4.0, mscrowks.dll has been replaced with the clr.dll module.

Installing Debugging Tools for Windows

Before we use the SOS extension, make sure you have downloaded the latest version of Debugging Tools for Windows which is a free download package (available in 32-bit and 62-bit) and consist of a set of powerful debuggers and tools to troubleshoot your application. I have chosen the link which says Debugging Tools for Windows 32-bit Version. After downloading winsdk_web.exe, run it and choose ‘Debugging Tools for Windows’ under ‘Common Utilities’ in the wizard, as shown below.

winsdkinstallation0207.png

Read more: dot net curry

Posted via email from Jasper-net

0 comments: