1 //===-- ValueObjectConstResult.h --------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ValueObjectConstResult_h_
11 #define liblldb_ValueObjectConstResult_h_
15 // Other libraries and framework includes
17 #include "lldb/Core/ValueObject.h"
19 #include "lldb/Core/ValueObjectConstResultImpl.h"
21 namespace lldb_private {
23 //----------------------------------------------------------------------
24 // A frozen ValueObject copied into host memory
25 //----------------------------------------------------------------------
26 class ValueObjectConstResult : public ValueObject
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);
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);
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,
49 lldb::addr_t address = LLDB_INVALID_ADDRESS);
51 static lldb::ValueObjectSP
52 Create (ExecutionContextScope *exe_scope,
53 const ClangASTType &clang_type,
54 const ConstString &name,
56 AddressType address_type,
57 uint32_t addr_byte_size);
59 static lldb::ValueObjectSP
60 Create (ExecutionContextScope *exe_scope,
62 const ConstString &name);
64 // When an expression fails to evaluate, we return an error
65 static lldb::ValueObjectSP
66 Create (ExecutionContextScope *exe_scope,
69 virtual ~ValueObjectConstResult();
74 virtual lldb::ValueType
78 CalculateNumChildren();
87 SetByteSize (size_t size);
89 virtual lldb::ValueObjectSP
90 Dereference (Error &error);
93 CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
95 virtual lldb::ValueObjectSP
96 GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
98 virtual lldb::ValueObjectSP
99 AddressOf (Error &error);
102 GetAddressOf (bool scalar_is_load_address = true,
103 AddressType *address_type = NULL);
106 GetPointeeData (DataExtractor& data,
107 uint32_t item_idx = 0,
108 uint32_t item_count = 1);
113 return m_impl.GetLiveAddress();
117 SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
118 AddressType address_type = eAddressTypeLoad)
120 m_impl.SetLiveAddress(addr,
124 virtual lldb::ValueObjectSP
125 GetDynamicValue (lldb::DynamicValueType valueType);
134 ConstString m_type_name;
135 uint64_t m_byte_size;
137 ValueObjectConstResultImpl m_impl;
140 friend class ValueObjectConstResultImpl;
141 ValueObjectConstResult (ExecutionContextScope *exe_scope,
142 lldb::ByteOrder byte_order,
143 uint32_t addr_byte_size,
144 lldb::addr_t address);
146 ValueObjectConstResult (ExecutionContextScope *exe_scope,
147 const ClangASTType &clang_type,
148 const ConstString &name,
149 const DataExtractor &data,
150 lldb::addr_t address);
152 ValueObjectConstResult (ExecutionContextScope *exe_scope,
153 const ClangASTType &clang_type,
154 const ConstString &name,
155 const lldb::DataBufferSP &result_data_sp,
156 lldb::ByteOrder byte_order,
158 lldb::addr_t address);
160 ValueObjectConstResult (ExecutionContextScope *exe_scope,
161 const ClangASTType &clang_type,
162 const ConstString &name,
163 lldb::addr_t address,
164 AddressType address_type,
165 uint32_t addr_byte_size);
167 ValueObjectConstResult (ExecutionContextScope *exe_scope,
169 const ConstString &name);
171 ValueObjectConstResult (ExecutionContextScope *exe_scope,
174 DISALLOW_COPY_AND_ASSIGN (ValueObjectConstResult);
177 } // namespace lldb_private
179 #endif // liblldb_ValueObjectConstResult_h_