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,
63 Module* module = nullptr);
65 // When an expression fails to evaluate, we return an error
66 static lldb::ValueObjectSP
67 Create (ExecutionContextScope *exe_scope,
70 virtual ~ValueObjectConstResult();
75 virtual lldb::ValueType
79 CalculateNumChildren();
91 SetByteSize (size_t size);
93 virtual lldb::ValueObjectSP
94 Dereference (Error &error);
97 CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
99 virtual lldb::ValueObjectSP
100 GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
102 virtual lldb::ValueObjectSP
103 AddressOf (Error &error);
106 GetAddressOf (bool scalar_is_load_address = true,
107 AddressType *address_type = NULL);
110 GetPointeeData (DataExtractor& data,
111 uint32_t item_idx = 0,
112 uint32_t item_count = 1);
117 return m_impl.GetLiveAddress();
121 SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
122 AddressType address_type = eAddressTypeLoad)
124 m_impl.SetLiveAddress(addr,
128 virtual lldb::ValueObjectSP
129 GetDynamicValue (lldb::DynamicValueType valueType);
131 virtual lldb::LanguageType
132 GetPreferredDisplayLanguage ();
141 ConstString m_type_name;
142 uint64_t m_byte_size;
144 ValueObjectConstResultImpl m_impl;
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);
153 ValueObjectConstResult (ExecutionContextScope *exe_scope,
154 const ClangASTType &clang_type,
155 const ConstString &name,
156 const DataExtractor &data,
157 lldb::addr_t address);
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,
165 lldb::addr_t address);
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);
174 ValueObjectConstResult (ExecutionContextScope *exe_scope,
176 const ConstString &name,
177 Module* module = nullptr);
179 ValueObjectConstResult (ExecutionContextScope *exe_scope,
182 DISALLOW_COPY_AND_ASSIGN (ValueObjectConstResult);
185 } // namespace lldb_private
187 #endif // liblldb_ValueObjectConstResult_h_