summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
index 539a53bc3ed..20b93c1d2c5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h
@@ -37,9 +37,12 @@ static const uptr kProtectionWrite = 2;
static const uptr kProtectionExecute = 4;
static const uptr kProtectionShared = 8;
-struct MemoryMappedSegment {
+struct MemoryMappedSegmentData;
+
+class MemoryMappedSegment {
+ public:
MemoryMappedSegment(char *buff = nullptr, uptr size = 0)
- : filename(buff), filename_size(size) {}
+ : filename(buff), filename_size(size), data_(nullptr) {}
~MemoryMappedSegment() {}
bool IsReadable() const { return protection & kProtectionRead; }
@@ -47,6 +50,8 @@ struct MemoryMappedSegment {
bool IsExecutable() const { return protection & kProtectionExecute; }
bool IsShared() const { return protection & kProtectionShared; }
+ void AddAddressRanges(LoadedModule *module);
+
uptr start;
uptr end;
uptr offset;
@@ -55,6 +60,12 @@ struct MemoryMappedSegment {
uptr protection;
ModuleArch arch;
u8 uuid[kModuleUUIDSize];
+
+ private:
+ friend class MemoryMappingLayout;
+
+ // This field is assigned and owned by MemoryMappingLayout if needed
+ MemoryMappedSegmentData *data_;
};
class MemoryMappingLayout {
OpenPOWER on IntegriCloud