1 //===-- ValueObjectConstResultImpl.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_ValueObjectConstResultImpl_h_
11 #define liblldb_ValueObjectConstResultImpl_h_
15 // Other libraries and framework includes
17 #include "lldb/Core/ValueObject.h"
19 namespace lldb_private {
21 //----------------------------------------------------------------------
22 // A class wrapping common implementation details for operations in
23 // ValueObjectConstResult ( & Child ) that may need to jump from the host
24 // memory space into the target's memory space
25 //----------------------------------------------------------------------
26 class ValueObjectConstResultImpl {
28 ValueObjectConstResultImpl(ValueObject *valobj,
29 lldb::addr_t live_address = LLDB_INVALID_ADDRESS);
31 virtual ~ValueObjectConstResultImpl() = default;
33 lldb::ValueObjectSP Dereference(Error &error);
35 ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
36 int32_t synthetic_index);
39 GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type,
41 ConstString name_const_str = ConstString());
43 lldb::ValueObjectSP AddressOf(Error &error);
45 lldb::addr_t GetLiveAddress() { return m_live_address; }
47 lldb::ValueObjectSP Cast(const CompilerType &compiler_type);
49 void SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
50 AddressType address_type = eAddressTypeLoad) {
51 m_live_address = addr;
52 m_live_address_type = address_type;
55 virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
56 AddressType *address_type = nullptr);
58 virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
59 uint32_t item_count = 1);
62 ValueObject *m_impl_backend;
63 lldb::addr_t m_live_address;
64 AddressType m_live_address_type;
65 lldb::ValueObjectSP m_load_addr_backend;
66 lldb::ValueObjectSP m_address_of_backend;
68 DISALLOW_COPY_AND_ASSIGN(ValueObjectConstResultImpl);
71 } // namespace lldb_private
73 #endif // liblldb_ValueObjectConstResultImpl_h_