Add ThreadSanitizer debugging support.
authorKuba Brecka <kuba.brecka@gmail.com>
Wed, 23 Mar 2016 15:36:22 +0000 (15:36 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Wed, 23 Mar 2016 15:36:22 +0000 (15:36 +0000)
commit6a83143650aeb02e9c53bd5f7b7b5253a6c8b157
tree84b85e5d71064a4c24d0100811f7114f2143ab2f
parentd68ed85401a5b1d40fb6065bcbd363e1bd78402d
Add ThreadSanitizer debugging support.

This patch adds ThreadSanitizer support into LLDB:
- Adding a new InstrumentationRuntime plugin, ThreadSanitizerRuntime, in the same way ASan is implemented.
- A breakpoint stops in `__tsan_on_report`, then we extract all sorts of information by evaluating an expression. We then populate this into StopReasonExtendedInfo.
- SBThread gets a new API, SBThread::GetStopReasonExtendedBacktraces(), which returns TSan’s backtraces in the form of regular SBThreads. Non-TSan stop reasons return an empty collection.
- Added some test cases.

Reviewed by Greg Clayton.

llvm-svn: 264162
17 files changed:
lldb/include/lldb/API/SBThread.h
lldb/include/lldb/API/SBThreadCollection.h
lldb/include/lldb/lldb-enumerations.h
lldb/lldb.xcodeproj/project.pbxproj
lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/main.c [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/main.c [new file with mode: 0644]
lldb/scripts/interface/SBThread.i
lldb/source/API/SBThread.cpp
lldb/source/API/SystemInitializerFull.cpp
lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt
lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/CMakeLists.txt [new file with mode: 0644]
lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp [new file with mode: 0644]
lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h [new file with mode: 0644]