|
1 | 1 | Debugging CoreCLR
|
2 | 2 | =================
|
3 | 3 |
|
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. |
5 | 5 |
|
6 | 6 | Debugging CoreCLR on Windows
|
7 | 7 | ============================
|
@@ -41,67 +41,84 @@ You can combine steps 4-8 and pass everything on the lldb command line:
|
41 | 41 |
|
42 | 42 | `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`
|
43 | 43 |
|
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: |
76 | 87 |
|
77 | 88 | bpmd -> sos bpmd
|
78 | 89 | clrstack -> sos ClrStack
|
79 | 90 | clrthreads -> sos Threads
|
80 |
| - dumpheap -> sos DumpHeap |
| 91 | + dso -> sos DumpStackObjects |
| 92 | + dumpclass -> sos DumpClass |
| 93 | + dumpheap -> sos DumpHeap |
| 94 | + dumpil -> sos DumpIL |
81 | 95 | dumplog -> sos DumpLog
|
82 | 96 | dumpmd -> sos DumpMD
|
| 97 | + dumpmodule -> sos DumpModule |
83 | 98 | dumpmt -> sos DumpMT
|
84 | 99 | dumpobj -> sos DumpObj
|
85 |
| - dso -> sos DumpStackObjects |
| 100 | + dumpstack -> sos DumpStack |
86 | 101 | eeheap -> sos EEHeap
|
| 102 | + eestack -> sos EEStack |
87 | 103 | gcroot -> sos GCRoot
|
88 | 104 | ip2md -> sos IP2MD
|
89 | 105 | name2ee -> sos Name2EE
|
90 | 106 | pe -> sos PrintException
|
91 | 107 | soshelp -> sos Help
|
92 | 108 |
|
93 |
| -Problems and limitations of lldb and sos: |
| 109 | + |
| 110 | +### Problems and limitations of lldb and sos ### |
94 | 111 |
|
95 | 112 | Many of the sos commands like clrstack or dso don't work on core dumps because lldb doesn't
|
96 | 113 | return the actual OS thread id for a native thread. The "setsostid" command can be used to work
|
97 | 114 | around this lldb bug. Use the "clrthreads" to find the os tid and the lldb command "thread list"
|
98 | 115 | to find the thread index (#1 for example) for the current thread (* in first column). The first
|
99 | 116 | setsostid argument is the os tid and the second is the thread index: "setsosid ecd5 1".
|
100 | 117 |
|
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. |
102 | 119 |
|
103 | 120 | 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. |
105 | 122 |
|
106 | 123 | For more information on SOS commands see: https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx
|
107 | 124 |
|
|
0 commit comments