diff options
Diffstat (limited to 'include/lldb/Target/MemoryRegionInfo.h')
-rw-r--r-- | include/lldb/Target/MemoryRegionInfo.h | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/include/lldb/Target/MemoryRegionInfo.h b/include/lldb/Target/MemoryRegionInfo.h index 0726ad15e876..5c82a1f294dd 100644 --- a/include/lldb/Target/MemoryRegionInfo.h +++ b/include/lldb/Target/MemoryRegionInfo.h @@ -30,7 +30,8 @@ namespace lldb_private m_range (), m_read (eDontKnow), m_write (eDontKnow), - m_execute (eDontKnow) + m_execute (eDontKnow), + m_mapped (eDontKnow) { } @@ -75,6 +76,12 @@ namespace lldb_private return m_execute; } + OptionalBool + GetMapped () const + { + return m_mapped; + } + void SetReadable (OptionalBool val) { @@ -93,11 +100,63 @@ namespace lldb_private m_execute = val; } + void + SetMapped (OptionalBool val) + { + m_mapped = val; + } + + //---------------------------------------------------------------------- + // Get permissions as a uint32_t that is a mask of one or more bits from + // the lldb::Permissions + //---------------------------------------------------------------------- + uint32_t + GetLLDBPermissions() const + { + uint32_t permissions = 0; + if (m_read) + permissions |= lldb::ePermissionsReadable; + if (m_write) + permissions |= lldb::ePermissionsWritable; + if (m_execute) + permissions |= lldb::ePermissionsExecutable; + return permissions; + } + + //---------------------------------------------------------------------- + // Set permissions from a uint32_t that contains one or more bits from + // the lldb::Permissions + //---------------------------------------------------------------------- + void + SetLLDBPermissions(uint32_t permissions) + { + m_read = (permissions & lldb::ePermissionsReadable) ? eYes : eNo; + m_write = (permissions & lldb::ePermissionsWritable) ? eYes : eNo; + m_execute = (permissions & lldb::ePermissionsExecutable) ? eYes : eNo; + } + + bool + operator == (const MemoryRegionInfo &rhs) const + { + return m_range == rhs.m_range && + m_read == rhs.m_read && + m_write == rhs.m_write && + m_execute == rhs.m_execute && + m_mapped == rhs.m_mapped; + } + + bool + operator != (const MemoryRegionInfo &rhs) const + { + return !(*this == rhs); + } + protected: RangeType m_range; OptionalBool m_read; OptionalBool m_write; OptionalBool m_execute; + OptionalBool m_mapped; }; } |