llvm-project/lldb/test
Kuba Brecka afdf842b3f LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction
Reviewed at http://reviews.llvm.org/D5592

This patch gives LLDB some ability to interact with AddressSanitizer runtime library, on top of what we already have (historical memory stack traces provided by ASan). Namely, that's the ability to stop on an error caught by ASan, and access the report information that are associated with it. The report information is also exposed into SB API.

More precisely this patch...

adds a new plugin type, InstrumentationRuntime, which should serve as a generic superclass for other instrumentation runtime libraries, these plugins get notified when modules are loaded, so they get a chance to "activate" when a specific dynamic library is loaded
an instance of this plugin type, AddressSanitizerRuntime, which activates itself when it sees the ASan dynamic library or founds ASan statically linked in the executable
adds a collection of these plugins into the Process class
AddressSanitizerRuntime sets an internal breakpoint on __asan::AsanDie(), and when this breakpoint gets hit, it retrieves the report information from ASan
this breakpoint is then exposed as a new StopReason, eStopReasonInstrumentation, with a new StopInfo subclass, InstrumentationRuntimeStopInfo
the StopInfo superclass is extended with a m_extended_info field (it's a StructuredData::ObjectSP), that can hold arbitrary JSON-like data, which is the way the new plugin provides the report data
the "thread info" command now accepts a "-s" flag that prints out the JSON data of a stop reason (same way the "-j" flag works now)
SBThread has a new API, GetStopReasonExtendedInfoAsJSON, which dumps the JSON string into a SBStream
adds a test case for all of this
I plan to also get rid of the original ASan plugin (memory history stack traces) and use an instance of AddressSanitizerRuntime for that purpose.

Kuba

llvm-svn: 219546
2014-10-10 23:43:03 +00:00
..
api Add decorator for FreeBSD failure 2014-10-08 18:16:24 +00:00
arm_emulation Massive test suite cleanup to stop everyone from manually having to compute "mydir" inside each test case. 2013-12-10 23:19:29 +00:00
attic Initial commit of a new testsuite feature: test categories. 2012-09-21 19:10:53 +00:00
benchmarks Fixes a number of issue related to test portability on Windows. 2014-07-18 01:02:02 +00:00
example Initial commit of a new testsuite feature: test categories. 2012-09-21 19:10:53 +00:00
expression_command This test case was incorrect, it was relying on the fact 2014-10-07 20:59:00 +00:00
functionalities LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction 2014-10-10 23:43:03 +00:00
help Massive test suite cleanup to stop everyone from manually having to compute "mydir" inside each test case. 2013-12-10 23:19:29 +00:00
lang Get test executables compiling on Windows. 2014-08-13 17:44:53 +00:00
linux/builtin_trap Massive test suite cleanup to stop everyone from manually having to compute "mydir" inside each test case. 2013-12-10 23:19:29 +00:00
logging I changed the logging test to just test that logging doesn't crash and does produce output. That's 2014-03-19 23:55:54 +00:00
macosx Remove shell-globbing from all test makefiles. 2014-07-31 21:03:11 +00:00
make Use consistent capitalization for ENABLE_THREADS in tests 2014-08-13 18:27:12 +00:00
pexpect-2.4 Eliminate kernel warning when running tests on FreeBSD 2014-02-18 21:33:10 +00:00
plugins Make the test runner understand Windows command shell execution. 2014-07-22 16:19:29 +00:00
python_api Limit test to Darwin 2014-10-02 20:18:21 +00:00
settings Fixes a number of issue related to test portability on Windows. 2014-07-18 01:02:02 +00:00
source-manager Make the test runner understand Windows command shell execution. 2014-07-22 16:19:29 +00:00
terminal Fixes a number of issue related to test portability on Windows. 2014-07-18 01:02:02 +00:00
tools/lldb-gdbserver llgs: fix thread names broken by recent native thread changes. 2014-09-12 22:51:49 +00:00
types Check if "golden_output.txt" exists before trying to delete it rather than just raising an uncaught error. 2014-03-19 19:45:37 +00:00
unittest2 Added a simple legend to the unit test 'dots' output, to aid understandability. 2013-09-25 20:47:51 +00:00
warnings/uuid Fixes a number of issue related to test portability on Windows. 2014-07-18 01:02:02 +00:00
.categories Initial commit of a new testsuite feature: test categories. 2012-09-21 19:10:53 +00:00
CMakeLists.txt Fix test execution: the cmake keyword is CACHE, not CACHED 2014-08-01 16:57:46 +00:00
Makefile Rename dosep.ty to dosep.py 2014-07-21 16:16:31 +00:00
README-TestSuite Fix typos. 2014-07-01 21:22:11 +00:00
argparse_compat.py Include a small argparse compatibility layer for Python < 2.7 2013-02-16 09:05:23 +00:00
bench-history Add bench entries. 2011-11-29 19:13:38 +00:00
bench.py Establish a baseline for bench.py score by using a fixed lldb executable as the 2011-10-26 22:58:02 +00:00
blacklist.py
crashinfo.c Alignment fix 2014-01-08 03:14:18 +00:00
dosep.py Rename dosep.ty to dosep.py 2014-07-21 16:16:31 +00:00
dotest.py Fix some python shutdown / ordering issues. 2014-08-08 23:20:25 +00:00
lldbbench.py Tests decorated with @benchmarks_test do not participate in the remote-macosx test suite run. 2012-04-19 23:50:00 +00:00
lldbtest.py Fix exception text to match function name 2014-10-07 01:57:52 +00:00
lldbutil.py Print the new eStopReasonExec in stop_reason_to_str. 2014-04-03 01:25:28 +00:00
progress.py The new progress bar mode was losing us information compared to the old dots mode in that we would have no way of knowing about test failures (short of peeking into the test result directory.. and you're not supposed to peek!) 2013-02-09 00:37:07 +00:00
redo.py The new ReadStringFromMemory() API does not work correctly with NSStrings that have an explicit length and no NULL terminator 2013-04-23 20:05:05 +00:00