1 //===-- ValueObjectConstResultImpl.h ----------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_ValueObjectConstResultImpl_h_
10 #define liblldb_ValueObjectConstResultImpl_h_
12 #include "lldb/Utility/ConstString.h"
13 #include "lldb/lldb-defines.h"
14 #include "lldb/lldb-forward.h"
15 #include "lldb/lldb-private-enumerations.h"
16 #include "lldb/lldb-types.h"
20 namespace lldb_private {
27 namespace lldb_private {
29 // A class wrapping common implementation details for operations in
30 // ValueObjectConstResult ( & Child ) that may need to jump from the host
31 // memory space into the target's memory space
32 class ValueObjectConstResultImpl {
34 ValueObjectConstResultImpl(ValueObject *valobj,
35 lldb::addr_t live_address = LLDB_INVALID_ADDRESS);
37 virtual ~ValueObjectConstResultImpl() = default;
39 lldb::ValueObjectSP Dereference(Status &error);
41 ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
42 int32_t synthetic_index);
45 GetSyntheticChildAtOffset(uint32_t offset, const CompilerType &type,
47 ConstString name_const_str = ConstString());
49 lldb::ValueObjectSP AddressOf(Status &error);
51 lldb::addr_t GetLiveAddress() { return m_live_address; }
53 lldb::ValueObjectSP Cast(const CompilerType &compiler_type);
55 void SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS,
56 AddressType address_type = eAddressTypeLoad) {
57 m_live_address = addr;
58 m_live_address_type = address_type;
61 virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
62 AddressType *address_type = nullptr);
64 virtual size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
65 uint32_t item_count = 1);
68 ValueObject *m_impl_backend;
69 lldb::addr_t m_live_address;
70 AddressType m_live_address_type;
71 lldb::ValueObjectSP m_load_addr_backend;
72 lldb::ValueObjectSP m_address_of_backend;
74 DISALLOW_COPY_AND_ASSIGN(ValueObjectConstResultImpl);
77 } // namespace lldb_private
79 #endif // liblldb_ValueObjectConstResultImpl_h_