[asan_symbolize] Teach `asan_symbolize.py` to symbolicate using a module map
authorDan Liew <dan@su-root.co.uk>
Fri, 26 Apr 2019 16:54:09 +0000 (16:54 +0000)
committerDan Liew <dan@su-root.co.uk>
Fri, 26 Apr 2019 16:54:09 +0000 (16:54 +0000)
commit60f5df948b0dd49349baf4326cebfb0b5e6bacf2
treeeb765d87a63f6ba018138727792a261c01916022
parentc0fa4ec01dd1c3837b31e142ceb20845421e34ab
[asan_symbolize] Teach `asan_symbolize.py` to symbolicate using a module map

Summary:
The use case here is to be able get the UUIDs of the modules that need
to be symbolicated so that external plugins can see them. This
information can be extracted from ASan reports if the `print_module_map`
ASan option is enabled. Currently printing of the module map is only
implemented on Darwin and so this is effectively a Darwin only feature
right now.

The module map hooks into symbolization using the new plugin
infrastructure. A new hook in `AsanSymbolizerPlugInProxy` (and in
`AsanSymbolizerPlugIn`) is also provided to allow external plugins to hook
into the module look up process. This will allow external plugins to
look up modules with knowledge of their UUID.

The new plug-in is currently stored in the `asan_symbolize.py` script.
We could potentially move this into a separate file in the future (to
reduce clutter) if we can come up with a policy for where to search for
plugins that should always get loaded.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 359322
compiler-rt/lib/asan/scripts/asan_symbolize.py
compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-with-module-map.cc [new file with mode: 0644]