0:003> .load C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll
0:003> !help
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help <functionname>" for detailed info on that function.
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads
DumpArray (da) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue EHInfo
PrintException (pe) COMState
TraverseHeap BPMD
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD VMMap
Token2EE VMStat
EEVersion ProcInfo
DumpModule StopOnException (soe)
ThreadPool MinidumpMode
DumpAssembly
DumpMethodSig Other
DumpRuntimeTypes -----------------------------
DumpSig FAQ
RCWCleanupList
DumpIL
0:003> !dumpdomain
--------------------------------------
System Domain: 7a38bb38
LowFrequencyHeap: 7a38bb5c
HighFrequencyHeap: 7a38bbb8
StubHeap: 7a38bc14
Stage: OPEN
Name: None
--------------------------------------
Shared Domain: 7a38c110
LowFrequencyHeap: 7a38c134
HighFrequencyHeap: 7a38c190
StubHeap: 7a38c1ec
Stage: OPEN
Name: None
Assembly: 00161548
--------------------------------------
Domain 1: 00154808
LowFrequencyHeap: 0015482c
HighFrequencyHeap: 00154888
StubHeap: 001548e4
Stage: OPEN
SecurityDescriptor: 0014a5a8
Name: dotnetForWindbg.exe
Assembly: 00161548 [C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll]
ClassLoader: 0014ea40
SecurityDescriptor: 0014d2e0
Module Name
790c2000 C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll
Assembly: 001695e0 [D:\debug\dotnetForWindbg.exe]
ClassLoader: 00169668
SecurityDescriptor: 00168ef0
Module Name
00a52c14 D:\debug\dotnetForWindbg.exe
0:003> !threads
ThreadCount: 2
UnstartedThread: 0
BackgroundThread: 1
PendingThread: 0
DeadThread: 0
Hosted Runtime: no
PreEmptive GC Alloc Lock
ID OSID ThreadOBJ State GC Context Domain Count APT Exception
0 1 990 0014a600 200a020 Enabled 013a39a8:013a3fe8 00154808 0 MTA
2 2 e18 0015d740 b220 Enabled 00000000:00000000 00154808 0 MTA (Finalizer)
0:003> ~*e!clrstack
OS Thread Id: 0x990 (0)
ESP EIP
0012f424 7c82ed54 [HelperMethodFrame: 0012f424] System.Threading.Thread.SleepInternal(Int32)
0012f478 793d80f5 System.Threading.Thread.Sleep(Int32)
0012f47c 00d700ba dotnetForWindbg.Program.Main(System.String[])
0012f69c 79e88f63 [GCFrame: 0012f69c]
OS Thread Id: 0xe38 (1)
Unable to walk the managed stack. The current thread is likely not a
managed thread. You can run !threads to get a list of managed threads in
the process
OS Thread Id: 0xe18 (2)
Failed to start stack walk: 80004005
OS Thread Id: 0x5e8 (3)
Unable to walk the managed stack. The current thread is likely not a
managed thread. You can run !threads to get a list of managed threads in
the process
0:000> !threadpool
CPU utilization 0%
Worker Thread: Total: 0 Running: 0 Idle: 0 MaxLimit: 0 MinLimit: 0
Work Request in Queue: 0
--------------------------------------
Number of Timers: 0
--------------------------------------
Completion Port Thread:Total: 0 Free: 0 MaxFree: 0 CurrentLimit: 0 MaxLimit: 1000 MinLimit: 0
0:000> !GCHandles
GC Handle Statistics:
Strong Handles: 14
Pinned Handles: 4
Async Pinned Handles: 0
Ref Count Handles: 0
Weak Long Handles: 0
Weak Short Handles: 1
Other Handles: 0
Statistics:
MT Count TotalSize Class Name
790f9c18 1 12 System.Object
790fc79c 1 24 System.Reflection.Assembly
790fb668 1 28 System.SharedStatics
790fac70 1 72 System.ExecutionEngineException
790fabcc 1 72 System.StackOverflowException
790fab28 1 72 System.OutOfMemoryException
790fb8c8 1 100 System.AppDomain
790fb238 2 104 System.Threading.Thread
790fd824 4 144 System.Security.PermissionSet
790fad14 2 144 System.Threading.ThreadAbortException
79124228 4 8736 System.Object[]
Total 19 objects
0:000> !EEHeap
Loader Heap:
--------------------------------------
System Domain: 7a38bb38
LowFrequencyHeap: Size: 0x0(0)bytes.
HighFrequencyHeap: 00a42000(8000:1000) Size: 0x1000(4096)bytes.
StubHeap: 00a4a000(2000:1000) Size: 0x1000(4096)bytes.
Virtual Call Stub Heap:
IndcellHeap: Size: 0x0(0)bytes.
LookupHeap: Size: 0x0(0)bytes.
ResolveHeap: Size: 0x0(0)bytes.
DispatchHeap: Size: 0x0(0)bytes.
CacheEntryHeap: Size: 0x0(0)bytes.
Total size: 0x2000(8192)bytes
--------------------------------------
Shared Domain: 7a38c110
LowFrequencyHeap: 00a70000(2000:1000) Size: 0x1000(4096)bytes.
HighFrequencyHeap: Size: 0x0(0)bytes.
StubHeap: 00a7a000(2000:1000) Size: 0x1000(4096)bytes.
Virtual Call Stub Heap:
IndcellHeap: Size: 0x0(0)bytes.
LookupHeap: Size: 0x0(0)bytes.
ResolveHeap: 00a8b000(5000:1000) Size: 0x1000(4096)bytes.
DispatchHeap: 00a87000(4000:1000) Size: 0x1000(4096)bytes.
CacheEntryHeap: Size: 0x0(0)bytes.
Total size: 0x4000(16384)bytes
--------------------------------------
Domain 1: 154808
LowFrequencyHeap: 00a50000(2000:2000) Size: 0x2000(8192)bytes.
HighFrequencyHeap: 00a52000(8000:2000) Size: 0x2000(8192)bytes.
StubHeap: Size: 0x0(0)bytes.
Virtual Call Stub Heap:
IndcellHeap: Size: 0x0(0)bytes.
LookupHeap: Size: 0x0(0)bytes.
ResolveHeap: Size: 0x0(0)bytes.
DispatchHeap: Size: 0x0(0)bytes.
CacheEntryHeap: Size: 0x0(0)bytes.
Total size: 0x4000(16384)bytes
--------------------------------------
Jit code heap:
LoaderCodeHeap: 00d70000(10000:1000) Size: 0x1000(4096)bytes.
Total size: 0x1000(4096)bytes
--------------------------------------
Module Thunk heaps:
Module 790c2000: Size: 0x0(0)bytes.
Module 00a52c14: Size: 0x0(0)bytes.
Total size: 0x0(0)bytes
--------------------------------------
Module Lookup Table heaps:
Module 790c2000: Size: 0x0(0)bytes.
Module 00a52c14: Size: 0x0(0)bytes.
Total size: 0x0(0)bytes
--------------------------------------
Total LoaderHeap size: 0xb000(45056)bytes
=======================================
Number of GC Heaps: 1
generation 0 starts at 0x013a1018
generation 1 starts at 0x013a100c
generation 2 starts at 0x013a1000
ephemeral segment allocation context: none
segment begin allocated size
0015f300 790d6358 790f5800 0x0001f4a8(128168)
013a0000 013a1000 013a3ff4 0x00002ff4(12276)
Large object heap starts at 0x023a1000
segment begin allocated size
023a0000 023a1000 023a3250 0x00002250(8784)
Total Size 0x246ec(149228)
------------------------------
GC Heap Size 0x246ec(149228)
SOSEX - Copyright 2007-2011 by Steve Johnson - http://www.stevestechspot.com/
X64
https://files.cnblogs.com/ahuo/sosex_64.zip
X86
https://files.cnblogs.com/ahuo/sosex_32.zip