Create a version resilient interface between sos (libsos.so) and the lldb plugin
authorMike McLaughlin <mikem@microsoft.com>
Sat, 20 Feb 2016 08:27:33 +0000 (00:27 -0800)
committerMike McLaughlin <mikem@microsoft.com>
Thu, 25 Feb 2016 23:54:25 +0000 (15:54 -0800)
commit266ee6dc6d688ec973acfee2e30d61877cd288be
tree775844e5932c1311052e02abe63d2a983286be80
parentd7f2265ca022f780a632918ae642fb4d3986064e
Create a version resilient interface between sos (libsos.so) and the lldb plugin
(libsosplugin.so). There is a ILLDBServices interface between the two with a proper
QI/Addref/Release interface so we can add new interfaces later and still be backwards
and forward compatible. Internally in sos there is a DebugClient wrapper around this
interface that makes it look like all the individual dbgeng interfaces (IDebugControl4,
IDebugSymbols, IDebugDataSpaces, etc) even with QI, etc.

Enable the sos the u (clru), DumpStack (dumpstack), EEStack (eestack), DumpIL (dumpil), DumpSig and
DumpSigElem commands (aliases in parans).

Add the clrstack -f option that displays the intermixed native and managed frames
when managed assembly and offsets.

Implement GetContextFromFrame. Enable the _EFN_* exported functions.

Add source file/line number support (native only) via GetLineByOffset.

Fix bug when executed just "sos". Displays help now.

Disable the U -gcinfo option since it isn't implemented on xplat because it uses Windows fibers.

Fixed a problem where some HelperMethodFrames were not unwinding; clrstack would stop without displaying
managed functions on the stack. The HelperMethodFrames were not sometimes unwinding because the lldb
VirtualUnwind used by the DAC was using (via the data target) to do the out of context unwind has some
limitations.  lldb doesn't have a way to unwind an arbitrary register context so the VirtualUnwind
implementation searches through the thread's frames until it finds a match and returns the next one. The
match was an exact match and in some cases it didn't find a frame. Changed it to check if the incoming
context's SP is in between frames and return the next one if so.

Only add the special internal "corerun" lldb plugin command in debug builds.
25 files changed:
src/ToolBox/SOS/Strike/CMakeLists.txt
src/ToolBox/SOS/Strike/datatarget.cpp
src/ToolBox/SOS/Strike/disasm.cpp
src/ToolBox/SOS/Strike/disasm.h
src/ToolBox/SOS/Strike/disasmX86.cpp
src/ToolBox/SOS/Strike/exts.cpp
src/ToolBox/SOS/Strike/exts.h
src/ToolBox/SOS/Strike/inc/dbgeng.h [new file with mode: 0644]
src/ToolBox/SOS/Strike/inc/dbghelp.h [moved from src/ToolBox/SOS/lldbplugin/inc/dbghelp.h with 54% similarity]
src/ToolBox/SOS/Strike/inc/wdbgexts.h [moved from src/ToolBox/SOS/lldbplugin/inc/wdbgexts.h with 100% similarity]
src/ToolBox/SOS/Strike/platformspecific.h
src/ToolBox/SOS/Strike/sos_stacktrace.h
src/ToolBox/SOS/Strike/sosdocs.txt
src/ToolBox/SOS/Strike/sosdocsunix.txt
src/ToolBox/SOS/Strike/strike.cpp
src/ToolBox/SOS/Strike/util.cpp
src/ToolBox/SOS/Strike/util.h
src/ToolBox/SOS/lldbplugin/CMakeLists.txt
src/ToolBox/SOS/lldbplugin/inc/lldbservices.h [moved from src/ToolBox/SOS/lldbplugin/inc/dbgeng.h with 70% similarity]
src/ToolBox/SOS/lldbplugin/mstypes.h
src/ToolBox/SOS/lldbplugin/services.cpp [moved from src/ToolBox/SOS/lldbplugin/debugclient.cpp with 73% similarity]
src/ToolBox/SOS/lldbplugin/services.h [moved from src/ToolBox/SOS/lldbplugin/debugclient.h with 73% similarity]
src/ToolBox/SOS/lldbplugin/soscommand.cpp
src/ToolBox/SOS/lldbplugin/sosplugin.cpp
src/ToolBox/SOS/lldbplugin/sosplugin.h