Skip to content

Commit d43ff11

Browse files
author
Mike McLaughlin
committed
Update SOS documentation.
1 parent 1a9eb1c commit d43ff11

File tree

2 files changed

+56
-39
lines changed

2 files changed

+56
-39
lines changed

Documentation/building/debugging-instructions.md

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Debugging CoreCLR
22
=================
33

4-
These instructions will lead you through debugging CoreCLR on Windows. They will be expanded to support Linux and OS X when we have good instructions for that.
4+
These instructions will lead you through debugging CoreCLR on Windows and Linux. They will be expanded to support OS X when we have good instructions for that.
55

66
Debugging CoreCLR on Windows
77
============================
@@ -41,67 +41,84 @@ You can combine steps 4-8 and pass everything on the lldb command line:
4141

4242
`lldb-3.6 -o "plugin load libsosplugin.so" -o "process launch -s" -o "process handle -s false SIGUSR1 SIGUSR2" -o "breakpoint set -n LoadLibraryExW" corerun HelloWorld.exe linux`
4343

44-
SOS commands supported by the lldb plugin:
45-
46-
bpmd
47-
ClrStack
48-
DumpStackObjects
49-
DumpMD
50-
DumpClass
51-
DumpMT
52-
DumpArray
53-
DumpObj
54-
DumpAssembly
55-
DumpDomain
56-
DumpHeap
57-
DumpLog
58-
DumpModule
59-
DumpRuntimeTypes
60-
DumpVC
61-
EEHeap
62-
EHInfo
63-
FindAppDomain
64-
GCRoot
65-
GCInfo
66-
Help
67-
IP2MD
68-
Name2EE
69-
PrintException
70-
ThreadState
71-
Threads
72-
Token2EE
73-
VerifyHeap
74-
75-
There are some aliases for the most common commands:
44+
### SOS commands ###
45+
46+
This is the full list of commands currently supported by SOS. LLDB is case-sensitive unlike windbg.
47+
48+
Type "soshelp <functionname>" for detailed info on that function.
49+
50+
Object Inspection Examining code and stacks
51+
----------------------------- -----------------------------
52+
DumpObj (dumpobj) Threads (clrthreads)
53+
DumpArray ThreadState
54+
DumpStackObjects (dso) IP2MD (ip2md)
55+
DumpHeap (dumpheap) u (clru)
56+
DumpVC DumpStack (dumpstack)
57+
GCRoot (gcroot) EEStack (eestack)
58+
PrintException (pe) ClrStack (clrstack)
59+
GCInfo
60+
EHInfo
61+
bpmd (bpmd)
62+
63+
Examining CLR data structures Diagnostic Utilities
64+
----------------------------- -----------------------------
65+
DumpDomain VerifyHeap
66+
EEHeap (eeheap) FindAppDomain
67+
Name2EE (name2ee) DumpLog (dumplog)
68+
DumpMT (dumpmt)
69+
DumpClass (dumpclass)
70+
DumpMD (dumpmd)
71+
Token2EE
72+
DumpModule (dumpmodule)
73+
DumpAssembly
74+
DumpRuntimeTypes
75+
DumpIL (dumpil)
76+
DumpSig
77+
DumpSigElem
78+
79+
Other
80+
-----------------------------
81+
FAQ
82+
Help (soshelp)
83+
84+
###Aliases###
85+
By default you can reach all the SOS commands by using: _sos [command\_name]_
86+
However the common commands have been aliased so that you don't need the SOS prefix:
7687

7788
bpmd -> sos bpmd
7889
clrstack -> sos ClrStack
7990
clrthreads -> sos Threads
80-
dumpheap -> sos DumpHeap
91+
dso -> sos DumpStackObjects
92+
dumpclass -> sos DumpClass
93+
dumpheap -> sos DumpHeap
94+
dumpil -> sos DumpIL
8195
dumplog -> sos DumpLog
8296
dumpmd -> sos DumpMD
97+
dumpmodule -> sos DumpModule
8398
dumpmt -> sos DumpMT
8499
dumpobj -> sos DumpObj
85-
dso -> sos DumpStackObjects
100+
dumpstack -> sos DumpStack
86101
eeheap -> sos EEHeap
102+
eestack -> sos EEStack
87103
gcroot -> sos GCRoot
88104
ip2md -> sos IP2MD
89105
name2ee -> sos Name2EE
90106
pe -> sos PrintException
91107
soshelp -> sos Help
92108

93-
Problems and limitations of lldb and sos:
109+
110+
### Problems and limitations of lldb and sos ###
94111

95112
Many of the sos commands like clrstack or dso don't work on core dumps because lldb doesn't
96113
return the actual OS thread id for a native thread. The "setsostid" command can be used to work
97114
around this lldb bug. Use the "clrthreads" to find the os tid and the lldb command "thread list"
98115
to find the thread index (#1 for example) for the current thread (* in first column). The first
99116
setsostid argument is the os tid and the second is the thread index: "setsosid ecd5 1".
100117

101-
The "gcroot" command either crashes lldb 3.6 or returns invalid results. Works fine with lldb 3.7.
118+
The "gcroot" command either crashes lldb 3.6 or returns invalid results. Works fine with lldb 3.7 and 3.8.
102119

103120
Loading Linux core dumps with lldb 3.7 doesn't work. lldb 3.7 loads OSX and FreeBSD core dumps
104-
just fine.
121+
just fine. lldb 3.8 loads all the platform's core dumps without problem.
105122

106123
For more information on SOS commands see: https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx
107124

src/ToolBox/SOS/Strike/sosdocsunix.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DumpStackObjects (dso) IP2MD (ip2md)
2929
DumpHeap (dumpheap) u (clru)
3030
DumpVC DumpStack (dumpstack)
3131
GCRoot (gcroot) EEStack (eestack)
32-
PrintException (pe) CLRStack (clrstack)
32+
PrintException (pe) ClrStack (clrstack)
3333
GCInfo
3434
EHInfo
3535
bpmd (bpmd)

0 commit comments

Comments
 (0)