llvm-project/compiler-rt/test
Dan Liew 403d3187a7 [asan_symbolize] Add a simple plugin architecture
Summary:
This change adds a simple plugin architecture to `asan_symbolize.py`.
The motivation here is that sometimes it's necessary to perform extra
work to figure out where binaries with debug symbols can actually be
found. For example it might be the case that a remote service needs
to be queried for binaries and then copied to the local system.

This "extra work" can be extremely site-specific such that adding the
code directly into the `asan_symbolize.py` would just clutter the code
for a very niche use case. To avoid this, the `asan_symbolize.py` can
now load external code via a new `--plugins` command line option.

These plugins are loaded before main command line argument parsing so
that they can add their own command line options.

Right now the only hook into the behaviour of symbolization is the
`filter_binary_path()` function which assumes a very similar role
to the `binary_name_filter` function that was previously in the code.
We can add more hooks as necessary.

Code in the `asan_symbolize.py` script does not call plugin code
directly. Instead it uses a `AsanSymbolizerPlugInProxy` object.
This object

* Loads plugins from files.
* Manages the lifetime of the plugins.
* Provides an interface for calling into plugin functions and handles
  calling into multiple plugins.

To unify the way binary paths are filtered the old `sysroot_path_filter`
function (and associated code) has been turned into a simple plugin
(`SysRootFilterPlugIn`) that is always loaded. The plugin unloads
itself if the `-s` option is not present on the command line. Users
should not see any functional change relating to this command line
option.

Some simple tests are provided to illustrate what plugin code looks
like and also to check the functionality continues to work.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: srhines, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D60529

llvm-svn: 358657
2019-04-18 11:34:31 +00:00
..
BlocksRuntime Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan [asan_symbolize] Add a simple plugin architecture 2019-04-18 11:34:31 +00:00
builtins Revert "[builtins] Rounding mode support for addxf3/subxf3" 2019-03-27 04:18:37 +00:00
cfi compiler-rt tests: Unbreak cmake with LLVM_ENABLE_PIC=OFF on mac 2019-01-16 20:36:27 +00:00
dfsan Add weak definitions of trace-cmp hooks to dfsan 2018-06-01 21:59:25 +00:00
fuzzer [libFuzzer] add -features_dir= flag to dump unique input features on disk 2019-04-13 00:20:31 +00:00
hwasan hwasan: Enable -hwasan-allow-ifunc by default. 2019-04-09 00:25:59 +00:00
interception Revert "[interception] Check for export table's size before referring to its elements." 2017-01-22 03:30:14 +00:00
lsan [test] Detect glibc-2.27+ and XFAIL appropriate tests 2019-01-09 13:27:29 +00:00
msan [NFC] Use clearer naming for local variables 2019-04-10 23:23:17 +00:00
profile Prospective test fix in response to r358104. 2019-04-11 03:04:04 +00:00
safestack compiler-rt tests: Unbreak cmake with LLVM_ENABLE_PIC=OFF on mac 2019-01-16 20:36:27 +00:00
sanitizer_common [Sanitizer] Fix a possible write to freed memory in the wcrtomb interceptor 2019-04-08 08:39:50 +00:00
scudo [sanitizer] Remove "-android" from test_arch. 2019-02-25 22:32:30 +00:00
shadowcallstack Delete x86_64 ShadowCallStack support 2019-03-07 18:56:36 +00:00
tsan [TSan][libdispatch] Port gcd-sync-block-copy.mm to C++ 2019-04-16 01:34:38 +00:00
ubsan [Sanitizer] iOS: Pull up parallelism_group handling into common.lit.config 2019-02-15 22:12:36 +00:00
ubsan_minimal [compiler-rt][UBSan] Sanitization for alignment assumptions. 2019-01-15 09:44:27 +00:00
xray Add header <atomic> which is needed to compile with some older library versions. 2018-11-21 08:54:40 +00:00
.clang-format [compiler-rt] Use "ColumnLimit: 0" instead of "clang-format off" in tests 2018-12-01 01:24:29 +00:00
CMakeLists.txt [build] Rename clang-headers to clang-resource-headers 2019-03-04 21:19:53 +00:00
lit.common.cfg [TSan][libdispatch] Specify libdispatch header dir for lit tests 2019-04-04 17:25:43 +00:00
lit.common.configured.in [Sanitizer] Add 'dispatch' feature to be used in compiler-rt tests 2019-03-07 18:15:23 +00:00