]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/MemoryRegionInfo.h
Import to 0.6.1
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / MemoryRegionInfo.h
1 //===-- MemoryRegionInfo.h ---------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_MemoryRegionInfo_h
11 #define lldb_MemoryRegionInfo_h
12
13 #include "lldb/Core/RangeMap.h"
14 #include "lldb/Utility/Range.h"
15
16 namespace lldb_private
17 {
18     class MemoryRegionInfo
19     {
20     public:
21         typedef Range<lldb::addr_t, lldb::addr_t> RangeType;
22         
23         enum OptionalBool {
24             eDontKnow  = -1,
25             eNo         = 0,
26             eYes        = 1
27         };
28         
29         MemoryRegionInfo () :
30         m_range (),
31         m_read (eDontKnow),
32         m_write (eDontKnow),
33         m_execute (eDontKnow)
34         {
35         }
36         
37         ~MemoryRegionInfo ()
38         {
39         }
40         
41         RangeType &
42         GetRange()
43         {
44             return m_range;
45         }
46         
47         void
48         Clear()
49         {
50             m_range.Clear();
51             m_read = m_write = m_execute = eDontKnow;
52         }
53         
54         const RangeType &
55         GetRange() const
56         {
57             return m_range;
58         }
59         
60         OptionalBool
61         GetReadable () const
62         {
63             return m_read;
64         }
65         
66         OptionalBool
67         GetWritable () const
68         {
69             return m_write;
70         }
71         
72         OptionalBool
73         GetExecutable () const
74         {
75             return m_execute;
76         }
77         
78         void
79         SetReadable (OptionalBool val)
80         {
81             m_read = val;
82         }
83         
84         void
85         SetWritable (OptionalBool val)
86         {
87             m_write = val;
88         }
89         
90         void
91         SetExecutable (OptionalBool val)
92         {
93             m_execute = val;
94         }
95         
96     protected:
97         RangeType m_range;
98         OptionalBool m_read;
99         OptionalBool m_write;
100         OptionalBool m_execute;
101     };
102 }
103
104 #endif // #ifndef lldb_MemoryRegionInfo_h