How to: Use SOS

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic applies Topic does not apply

Standard

Topic applies

Topic applies

Topic applies

Topic does not apply

Pro and Team

Topic applies

Topic applies

Topic applies

Topic does not apply

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

To view dump information for an application written in managed code, you must use a tool named SOS, which is an external component that can be loaded into the debugger. Dump information for native code is displayed in the usual debugger windows. Therefore, SOS is not needed for debugging native code.

To use SOS, you must first load the SOS extension into the debugger using the Immediate Window. You then enter commands in the Immediate window, and can view output information there also. SOS does not use any other debugger windows, such as the Call Stack or Locals window.

SOS can be used to debug managed applications, as well as dump files. To debug a managed application by using SOS, you must attach the debugger in both native and managed mode. For information, see SOS Debugging Extension (SOS.dll). For more information, see the MSDN BUGSLAYER column entitled SOS: It's Not Just an ABBA Song Anymore.

For Help about how to use SOS, use the !help command described in the following procedure.

To load the SOS debugger extension

  1. Open the dump file.

    For more information, see How to: Save and Open Dump Files.

  2. On the Debug menu, click Start and wait for execution to break.

  3. In the Immediate window, type the following command:

    .load sos
    

    If the Immediate window cannot find SOS, you might have to specify the full path, which is: %windir%\Microsoft.NET\Framework\<version>\sos.dll

    The version of SOS must match the version of the common language runtime used in the dump file.

To get SOS command Help

  1. After SOS is loaded, in the Immediate window, type the following command: !help.

  2. For more specific information about a command, type, !help command.

To stop an SOS command

  • On the Debug menu, click Stop Evaluation.

See Also

Concepts

Dumps

Reference

SOS Debugging Extension (SOS.dll)