Skip to content
lordmilko edited this page Mar 1, 2023 · 1 revision

In order to perform log level debugging/analysis of .NET programs you typically need to launch/attach to a program in WinDbg, load the SOS extension and then execute a variety of commands.

DebugTools contains a variety of cmdlets for retrieving some of the same data you can normally retrieve using SOS, using the same underlying APIs (ISOSDacInterface).

The following table lists the SOS related cmdlets available in DebugTools, and how they relate to WinDbg SOS commands

Cmdlet SOS Command Description
Get-SOSAppDomain !DumpDomain Displays the AppDomain at the specified address, or all AppDomains in the target process
Get-SOSAssembly !DumpAssembly Displays the assembly at the specified address, or all assemblies under a given AppDomain
Get-SOSFieldDesc Displays the field at the specified address, or all fields under a given method table
Get-SOSMethodDesc !DumpMD Displays the method at the specified address, or all methods under a given method table
Get-SOSMethodTable !DumpMT Displays the method table (which is typically a class or struct) at the specified address, or all method table under a given assembly or module
Get-SOSModule !DumpModule Displays the module at the specified address, or all modules under a given Assembly
Get-SOSStackTrace !clrstack Displays the call stack of a thread, optionally including parameters
Get-SOSThread !threads Lists all managed threads in the process
Connect-SOSProcess Connects to a process to allow executing SOS commands against it
Get-SOSProcess Lists all SOS sessions that have been established within the current PowerShell session
Disconnect-SOSProcess Disconnects from an SOS session
Clear-SOSDacCache Clears the DAC cache. The DAC automatically caches all data it retrieves, which may lead to stale data in some circumstances

Project Overview

User Guide

Clone this wiki locally