1 //===-- MemoryRegionInfo.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_MemoryRegionInfo_h
11 #define lldb_MemoryRegionInfo_h
13 #include "lldb/Core/RangeMap.h"
14 #include "lldb/Utility/Range.h"
16 namespace lldb_private
18 class MemoryRegionInfo
21 typedef Range<lldb::addr_t, lldb::addr_t> RangeType;
33 m_execute (eDontKnow),
52 m_read = m_write = m_execute = eDontKnow;
74 GetExecutable () const
86 SetReadable (OptionalBool val)
92 SetWritable (OptionalBool val)
98 SetExecutable (OptionalBool val)
104 SetMapped (OptionalBool val)
109 //----------------------------------------------------------------------
110 // Get permissions as a uint32_t that is a mask of one or more bits from
111 // the lldb::Permissions
112 //----------------------------------------------------------------------
114 GetLLDBPermissions() const
116 uint32_t permissions = 0;
118 permissions |= lldb::ePermissionsReadable;
120 permissions |= lldb::ePermissionsWritable;
122 permissions |= lldb::ePermissionsExecutable;
126 //----------------------------------------------------------------------
127 // Set permissions from a uint32_t that contains one or more bits from
128 // the lldb::Permissions
129 //----------------------------------------------------------------------
131 SetLLDBPermissions(uint32_t permissions)
133 m_read = (permissions & lldb::ePermissionsReadable) ? eYes : eNo;
134 m_write = (permissions & lldb::ePermissionsWritable) ? eYes : eNo;
135 m_execute = (permissions & lldb::ePermissionsExecutable) ? eYes : eNo;
139 operator == (const MemoryRegionInfo &rhs) const
141 return m_range == rhs.m_range &&
142 m_read == rhs.m_read &&
143 m_write == rhs.m_write &&
144 m_execute == rhs.m_execute &&
145 m_mapped == rhs.m_mapped;
149 operator != (const MemoryRegionInfo &rhs) const
151 return !(*this == rhs);
157 OptionalBool m_write;
158 OptionalBool m_execute;
159 OptionalBool m_mapped;
163 #endif // #ifndef lldb_MemoryRegionInfo_h