Move MemoryRegionInfo out of Target/Process.h into its own header.
authorTodd Fiala <todd.fiala@gmail.com>
Wed, 4 Jun 2014 20:13:37 +0000 (20:13 +0000)
committerTodd Fiala <todd.fiala@gmail.com>
Wed, 4 Jun 2014 20:13:37 +0000 (20:13 +0000)
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 [new file with mode: 0644]
lldb/include/lldb/Target/Process.h
lldb/lldb.xcodeproj/project.pbxproj

diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h
new file mode 100644 (file)
index 0000000..dac968d
--- /dev/null
@@ -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<lldb::addr_t, lldb::addr_t> 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
index cc145a2..c4c2c3a 100644 (file)
@@ -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<lldb::addr_t, lldb::addr_t> 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.
index 177493a..2ed69a4 100644 (file)
 /* 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 = "<group>"; };
                23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = "<group>"; };
                23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeEnumMember.h; path = include/lldb/API/SBTypeEnumMember.h; sourceTree = "<group>"; };
                23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = "<group>"; };
                                4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */,
                                2690B36F1381D5B600ECFBAE /* Memory.h */,
                                2690B3701381D5C300ECFBAE /* Memory.cpp */,
+                               2360092C193FB21500189DB1 /* MemoryRegionInfo.h */,
                                4CB443F612499B6E00C13DC2 /* ObjCLanguageRuntime.h */,
                                4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */,
                                495BBACF119A0DE700418BEA /* PathMappingList.h */,