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_
13 #include "lldb/Utility/ConstString.h"
14 #include "lldb/lldb-defines.h"
15 #include "lldb/lldb-forward.h"
16 #include "lldb/lldb-private-enumerations.h"
17 #include "lldb/lldb-types.h"
21 namespace lldb_private {
24 namespace lldb_private {
27 namespace lldb_private {
30 namespace lldb_private {
34 namespace lldb_private {
36 //----------------------------------------------------------------------
37 // A class wrapping common implementation details for operations in
38 // ValueObjectConstResult ( & Child ) that may need to jump from the host
39 // memory space into the target's memory space
40 //----------------------------------------------------------------------
41 class ValueObjectConstResultImpl {
43 ValueObjectConstResultImpl(ValueObject *valobj,
44 lldb::addr_t live_address = LLDB_INVALID_ADDRESS);
46 virtual ~ValueObjectConstResultImpl() = default;
48 lldb::ValueObjectSP Dereference(Status &error);
50 ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
51 int32_t synthetic_index);
54 GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type,
56 ConstString name_const_str = ConstString());
58 lldb::ValueObjectSP AddressOf(Status &error);
60 lldb::addr_t GetLiveAddress() { return m_live_address; }
62 lldb::ValueObjectSP Cast(const CompilerType &compiler_type);
64 void SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
65 AddressType address_type = eAddressTypeLoad) {
66 m_live_address = addr;
67 m_live_address_type = address_type;
70 virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
71 AddressType *address_type = nullptr);
73 virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
74 uint32_t item_count = 1);
77 ValueObject *m_impl_backend;
78 lldb::addr_t m_live_address;
79 AddressType m_live_address_type;
80 lldb::ValueObjectSP m_load_addr_backend;
81 lldb::ValueObjectSP m_address_of_backend;
83 DISALLOW_COPY_AND_ASSIGN(ValueObjectConstResultImpl);
86 } // namespace lldb_private
88 #endif // liblldb_ValueObjectConstResultImpl_h_