Introduction


Howdy! I’m Michael Stanton, and I work on the CLR dev team. Specifically I lead the Quick Response Team, and we look at some of the most godawful stress failures you can think of from various labs inside Microsoft. We also look at customer issues in conjunction with Product Support Services (PSS). What I intend to share here is my bag of tips and tricks for debugging in managed processes. Primary tools are WINDBG (or it’s cousins CDB and NTSD), and SOS.DLL, our team’s debugger extension with a set of nifty CLR-specific commands.


Until I can get there, here is a tidbit not everyone knows about: in V1.1 of the CLR, you can load SOS.DLL in Visual Studio. First, enable unmanaged debugging in your solution properties. Then in the Immediate Window during a debugging session, just type “.load sos” [edited April 2004 to fix a bug in my steps]. Then type “!help” and you’ll see a list of commands you can call, just as if you were debugging in WINDBG.


Happy hunting!


Comments (6)

  1. Scott Glasgow says:

    Appears that you can only do ".load sos.dll" when your code calls unmanaged code. If your managed code used another managed dll that calls unmanaged code, can you still load it? Tried briefly, but it said it couldn’t load it still so I stopped trying to play with it since I have a project to finish.

    P.S. Welcome aboard. Look forward to more tips and what-not from you.

  2. Wallym says:

    **Think Wayne’s World**

    I’m not worthy, I’m not worthy, I’m not worthy………

    Wally

  3. Yosi Taguri says:

    Welcome,

    you could do that even to the sos.dll that is compatible with v1.0

  4. Ian Hanschen says:

    I don’t suppose there’s any chance the immediate window could be extended to support the full range of commands that windbg supports for app debugging?

  5. John says:

    Hi, is there an url that shows how to debug managed applications using the windbg, so far I haven’t been succesfull

  6. avnrao says:

    hi, could you some one please post any links on how to use windbg for managed applications

    basically i am trying to understand the basics.

    thank you.