diff options
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h index 20b93c1d2c5..0e2deb2a24c 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h @@ -16,20 +16,12 @@ #include "sanitizer_common.h" #include "sanitizer_internal_defs.h" +#include "sanitizer_linux.h" +#include "sanitizer_mac.h" #include "sanitizer_mutex.h" namespace __sanitizer { -#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD -struct ProcSelfMapsBuff { - char *data; - uptr mmaped_size; - uptr len; -}; - -// Reads process memory map in an OS-specific way. -void ReadProcMaps(ProcSelfMapsBuff *proc_maps); -#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD // Memory protection masks. static const uptr kProtectionRead = 1; @@ -87,25 +79,7 @@ class MemoryMappingLayout { // FIXME: Hide implementation details for different platforms in // platform-specific files. -# if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD - ProcSelfMapsBuff proc_self_maps_; - const char *current_; - - // Static mappings cache. - static ProcSelfMapsBuff cached_proc_self_maps_; - static StaticSpinMutex cache_lock_; // protects cached_proc_self_maps_. -# elif SANITIZER_MAC - template <u32 kLCSegment, typename SegmentCommand> - bool NextSegmentLoad(MemoryMappedSegment *segment); - int current_image_; - u32 current_magic_; - u32 current_filetype_; - ModuleArch current_arch_; - u8 current_uuid_[kModuleUUIDSize]; - int current_load_cmd_count_; - char *current_load_cmd_addr_; - bool current_instrumented_; -# endif + MemoryMappingLayoutData data_; }; typedef void (*fill_profile_f)(uptr start, uptr rss, bool file, |