From ba78c15c9d1a80d5870464406fd5a6728e310af5 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Wed, 4 Jun 2014 20:13:37 +0000 Subject: [PATCH] Move MemoryRegionInfo out of Target/Process.h into its own header. lldb-gdbserver and NativeProcessProtocol will use MemoryRegionInfo but don't want to pull in Process.h. Pull this declaration and definition out into its own header. llvm-svn: 210213 --- lldb/include/lldb/Target/MemoryRegionInfo.h | 103 ++++++++++++++++++++++++++++ lldb/include/lldb/Target/Process.h | 86 +---------------------- lldb/lldb.xcodeproj/project.pbxproj | 2 + 3 files changed, 106 insertions(+), 85 deletions(-) create mode 100644 lldb/include/lldb/Target/MemoryRegionInfo.h diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h new file mode 100644 index 0000000..dac968d --- /dev/null +++ b/lldb/include/lldb/Target/MemoryRegionInfo.h @@ -0,0 +1,103 @@ +//===-- MemoryRegionInfo.h ---------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef lldb_MemoryRegionInfo_h +#define lldb_MemoryRegionInfo_h + +#include "lldb/Utility/Range.h" + +namespace lldb_private +{ + class MemoryRegionInfo + { + public: + typedef Range RangeType; + + enum OptionalBool { + eDontKnow = -1, + eNo = 0, + eYes = 1 + }; + + MemoryRegionInfo () : + m_range (), + m_read (eDontKnow), + m_write (eDontKnow), + m_execute (eDontKnow) + { + } + + ~MemoryRegionInfo () + { + } + + RangeType & + GetRange() + { + return m_range; + } + + void + Clear() + { + m_range.Clear(); + m_read = m_write = m_execute = eDontKnow; + } + + const RangeType & + GetRange() const + { + return m_range; + } + + OptionalBool + GetReadable () const + { + return m_read; + } + + OptionalBool + GetWritable () const + { + return m_write; + } + + OptionalBool + GetExecutable () const + { + return m_execute; + } + + void + SetReadable (OptionalBool val) + { + m_read = val; + } + + void + SetWritable (OptionalBool val) + { + m_write = val; + } + + void + SetExecutable (OptionalBool val) + { + m_execute = val; + } + + protected: + RangeType m_range; + OptionalBool m_read; + OptionalBool m_write; + OptionalBool m_execute; + }; +} + +#endif // #ifndef lldb_MemoryRegionInfo_h diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index cc145a2..c4c2c3a 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -44,6 +44,7 @@ #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/JITLoaderList.h" #include "lldb/Target/Memory.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/QueueList.h" #include "lldb/Target/ThreadList.h" #include "lldb/Target/UnixSignals.h" @@ -1335,91 +1336,6 @@ inline bool operator!= (const ProcessModID &lhs, const ProcessModID &rhs) return false; } -class MemoryRegionInfo -{ -public: - typedef Range RangeType; - - enum OptionalBool { - eDontKnow = -1, - eNo = 0, - eYes = 1 - }; - - MemoryRegionInfo () : - m_range (), - m_read (eDontKnow), - m_write (eDontKnow), - m_execute (eDontKnow) - { - } - - ~MemoryRegionInfo () - { - } - - RangeType & - GetRange() - { - return m_range; - } - - void - Clear() - { - m_range.Clear(); - m_read = m_write = m_execute = eDontKnow; - } - - const RangeType & - GetRange() const - { - return m_range; - } - - OptionalBool - GetReadable () const - { - return m_read; - } - - OptionalBool - GetWritable () const - { - return m_write; - } - - OptionalBool - GetExecutable () const - { - return m_execute; - } - - void - SetReadable (OptionalBool val) - { - m_read = val; - } - - void - SetWritable (OptionalBool val) - { - m_write = val; - } - - void - SetExecutable (OptionalBool val) - { - m_execute = val; - } - -protected: - RangeType m_range; - OptionalBool m_read; - OptionalBool m_write; - OptionalBool m_execute; -}; - //---------------------------------------------------------------------- /// @class Process Process.h "lldb/Target/Process.h" /// @brief A plug-in interface definition class for debugging a process. diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 177493a..2ed69a4 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -870,6 +870,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2360092C193FB21500189DB1 /* MemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemoryRegionInfo.h; path = include/lldb/Target/MemoryRegionInfo.h; sourceTree = ""; }; 23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = ""; }; 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeEnumMember.h; path = include/lldb/API/SBTypeEnumMember.h; sourceTree = ""; }; 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = ""; }; @@ -3432,6 +3433,7 @@ 4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */, 2690B36F1381D5B600ECFBAE /* Memory.h */, 2690B3701381D5C300ECFBAE /* Memory.cpp */, + 2360092C193FB21500189DB1 /* MemoryRegionInfo.h */, 4CB443F612499B6E00C13DC2 /* ObjCLanguageRuntime.h */, 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */, 495BBACF119A0DE700418BEA /* PathMappingList.h */, -- 2.7.4