How to: Use SOS
This topic applies to:
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
||||
Standard |
||||
Pro and Team |
Table legend:
Applies |
|
Does not apply |
|
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
Open the dump file.
For more information, see How to: Save and Open Dump Files.
On the Debug menu, click Start and wait for execution to break.
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
After SOS is loaded, in the Immediate window, type the following command: !help.
For more specific information about a command, type, !help command.
To stop an SOS command
- On the Debug menu, click Stop Evaluation.