]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectConstResult.h
Merge bmake 20151020
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / ValueObjectConstResult.h
1 //===-- ValueObjectConstResult.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 liblldb_ValueObjectConstResult_h_
11 #define liblldb_ValueObjectConstResult_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Core/ValueObject.h"
18
19 #include "lldb/Core/ValueObjectConstResultImpl.h"
20
21 namespace lldb_private {
22
23 //----------------------------------------------------------------------
24 // A frozen ValueObject copied into host memory
25 //----------------------------------------------------------------------
26 class ValueObjectConstResult : public ValueObject
27 {
28 public:
29     static lldb::ValueObjectSP
30     Create (ExecutionContextScope *exe_scope,
31             lldb::ByteOrder byte_order, 
32             uint32_t addr_byte_size,
33             lldb::addr_t address = LLDB_INVALID_ADDRESS);
34
35     static lldb::ValueObjectSP
36     Create (ExecutionContextScope *exe_scope,
37             const ClangASTType &clang_type,
38             const ConstString &name,
39             const DataExtractor &data,
40             lldb::addr_t address = LLDB_INVALID_ADDRESS);
41
42     static lldb::ValueObjectSP
43     Create (ExecutionContextScope *exe_scope,
44             const ClangASTType &clang_type,
45             const ConstString &name,
46             const lldb::DataBufferSP &result_data_sp,
47             lldb::ByteOrder byte_order, 
48             uint32_t addr_size,
49             lldb::addr_t address = LLDB_INVALID_ADDRESS);
50
51     static lldb::ValueObjectSP
52     Create (ExecutionContextScope *exe_scope,
53             const ClangASTType &clang_type,
54             const ConstString &name,
55             lldb::addr_t address,
56             AddressType address_type,
57             uint32_t addr_byte_size);
58
59     static lldb::ValueObjectSP
60     Create (ExecutionContextScope *exe_scope,
61             Value &value,
62             const ConstString &name,
63             Module* module = nullptr);
64
65     // When an expression fails to evaluate, we return an error
66     static lldb::ValueObjectSP
67     Create (ExecutionContextScope *exe_scope,
68             const Error& error);
69
70     virtual ~ValueObjectConstResult();
71
72     virtual uint64_t
73     GetByteSize();
74
75     virtual lldb::ValueType
76     GetValueType() const;
77
78     virtual size_t
79     CalculateNumChildren();
80
81     virtual ConstString
82     GetTypeName();
83
84     virtual ConstString
85     GetDisplayTypeName();
86     
87     virtual bool
88     IsInScope ();
89
90     void
91     SetByteSize (size_t size);
92     
93     virtual lldb::ValueObjectSP
94     Dereference (Error &error);
95     
96     virtual ValueObject *
97     CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
98     
99     virtual lldb::ValueObjectSP
100     GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
101     
102     virtual lldb::ValueObjectSP
103     AddressOf (Error &error);
104     
105     virtual lldb::addr_t
106     GetAddressOf (bool scalar_is_load_address = true,
107                   AddressType *address_type = NULL);
108     
109     virtual size_t
110     GetPointeeData (DataExtractor& data,
111                     uint32_t item_idx = 0,
112                                         uint32_t item_count = 1);
113     
114     virtual lldb::addr_t
115     GetLiveAddress()
116     {
117         return m_impl.GetLiveAddress();
118     }
119     
120     virtual void
121     SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
122                    AddressType address_type = eAddressTypeLoad)
123     {
124         m_impl.SetLiveAddress(addr,
125                               address_type);
126     }
127     
128     virtual lldb::ValueObjectSP
129     GetDynamicValue (lldb::DynamicValueType valueType);
130     
131     virtual lldb::LanguageType
132     GetPreferredDisplayLanguage ();
133
134 protected:
135     virtual bool
136     UpdateValue ();
137     
138     virtual ClangASTType
139     GetClangTypeImpl ();
140
141     ConstString m_type_name;
142     uint64_t m_byte_size;
143     
144     ValueObjectConstResultImpl m_impl;
145
146 private:
147     friend class ValueObjectConstResultImpl;
148     ValueObjectConstResult (ExecutionContextScope *exe_scope,
149                             lldb::ByteOrder byte_order, 
150                             uint32_t addr_byte_size,
151                             lldb::addr_t address);
152
153     ValueObjectConstResult (ExecutionContextScope *exe_scope,
154                             const ClangASTType &clang_type,
155                             const ConstString &name,
156                             const DataExtractor &data,
157                             lldb::addr_t address);
158
159     ValueObjectConstResult (ExecutionContextScope *exe_scope,
160                             const ClangASTType &clang_type,
161                             const ConstString &name,
162                             const lldb::DataBufferSP &result_data_sp,
163                             lldb::ByteOrder byte_order, 
164                             uint32_t addr_size,
165                             lldb::addr_t address);
166
167     ValueObjectConstResult (ExecutionContextScope *exe_scope,
168                             const ClangASTType &clang_type,
169                             const ConstString &name,
170                             lldb::addr_t address,
171                             AddressType address_type,
172                             uint32_t addr_byte_size);
173
174     ValueObjectConstResult (ExecutionContextScope *exe_scope,
175                             const Value &value,
176                             const ConstString &name,
177                             Module* module = nullptr);
178
179     ValueObjectConstResult (ExecutionContextScope *exe_scope,
180                             const Error& error);
181
182     DISALLOW_COPY_AND_ASSIGN (ValueObjectConstResult);
183 };
184
185 } // namespace lldb_private
186
187 #endif  // liblldb_ValueObjectConstResult_h_