diff options
author | Kuba Mracek <mracek@apple.com> | 2017-01-06 19:34:54 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-01-06 19:34:54 +0000 |
commit | 0aad13bae1d86febf022d0c9b0299183e1d00f34 (patch) | |
tree | aeaecb4e2e090ea3fcbe93677588a682f75a6081 /lib/sanitizer_common/sanitizer_common.cc | |
parent | d615dc8ac1e6e04b593eb7409b6ff609bc529761 (diff) |
[sanitizer] Track which modules are instrumented in LoadedModule objects
This patch adds tracking which modules are instrumented and which are not. On macOS, instrumented modules link against the ASan/TSan/... dylib, so we can just check if such a load command exists or not.
Differential Revision: https://reviews.llvm.org/D28263
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.cc b/lib/sanitizer_common/sanitizer_common.cc index 1c6fc3ef8..89c5c4511 100644 --- a/lib/sanitizer_common/sanitizer_common.cc +++ b/lib/sanitizer_common/sanitizer_common.cc @@ -260,10 +260,12 @@ void LoadedModule::set(const char *module_name, uptr base_address) { } void LoadedModule::set(const char *module_name, uptr base_address, - ModuleArch arch, u8 uuid[kModuleUUIDSize]) { + ModuleArch arch, u8 uuid[kModuleUUIDSize], + bool instrumented) { set(module_name, base_address); arch_ = arch; internal_memcpy(uuid_, uuid, sizeof(uuid_)); + instrumented_ = instrumented; } void LoadedModule::clear() { @@ -271,6 +273,7 @@ void LoadedModule::clear() { full_name_ = nullptr; arch_ = kModuleArchUnknown; internal_memset(uuid_, 0, kModuleUUIDSize); + instrumented_ = false; while (!ranges_.empty()) { AddressRange *r = ranges_.front(); ranges_.pop_front(); |