Archives for January 2015

Really Powerful Debugging With WinDBG & SOS.dll

If you have never used WinDBG or the SOS extensions before, read the following blog posts by Mike Taulty:

  • A word for WinDBG – Part 1
  • A word for WinDBG – Part 2

Mike walks you through a sample debugging session with WinDBG. Then in the second part, he focuses on the SOS extensions for .NET debugging. With the SOS extension you can do some seriously cool stuff:

  • View thread/threadpool info
  • View the finalizequeue
  • See what’s allocated on the managed heap
  • Determine what is keeping your managed object from being finalized by viewing it’s “roots”

If you have Visual C++ installed you can actually use SOS calls from the Visual Studio debugger! Read Mike’s post, that walks you through the setup and use of SOS from inside Visual Studio. As Mike points out, make sure you go to the project properties, choose Debug, and then check “Enabled unmanaged code debugging”. Be prepared the very first time you do this, it might be slow because the symbols have to be downloaded/loaded.