1 //===-- ValueObjectConstResultChild.h ----------------------------*- C++-*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_CORE_VALUEOBJECTCONSTRESULTCHILD_H 10 #define LLDB_CORE_VALUEOBJECTCONSTRESULTCHILD_H 11 12 #include "lldb/Core/ValueObjectChild.h" 13 #include "lldb/Core/ValueObjectConstResultImpl.h" 14 #include "lldb/Symbol/CompilerType.h" 15 #include "lldb/Utility/ConstString.h" 16 #include "lldb/lldb-defines.h" 17 #include "lldb/lldb-forward.h" 18 #include "lldb/lldb-types.h" 19 20 #include <cstddef> 21 #include <cstdint> 22 23 namespace lldb_private { 24 class DataExtractor; 25 class Status; 26 class ValueObject; 27 28 // A child of a ValueObjectConstResult. 29 class ValueObjectConstResultChild : public ValueObjectChild { 30 public: 31 ValueObjectConstResultChild(ValueObject &parent, 32 const CompilerType &compiler_type, 33 ConstString name, uint32_t byte_size, 34 int32_t byte_offset, uint32_t bitfield_bit_size, 35 uint32_t bitfield_bit_offset, bool is_base_class, 36 bool is_deref_of_parent, 37 lldb::addr_t live_address, 38 uint64_t language_flags); 39 40 ~ValueObjectConstResultChild() override; 41 42 lldb::ValueObjectSP Dereference(Status &error) override; 43 44 virtual CompilerType GetCompilerType() { 45 return ValueObjectChild::GetCompilerType(); 46 } 47 48 lldb::ValueObjectSP GetSyntheticChildAtOffset( 49 uint32_t offset, const CompilerType &type, bool can_create, 50 ConstString name_const_str = ConstString()) override; 51 52 lldb::ValueObjectSP AddressOf(Status &error) override; 53 54 lldb::addr_t GetAddressOf(bool scalar_is_load_address = true, 55 AddressType *address_type = nullptr) override; 56 57 size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0, 58 uint32_t item_count = 1) override; 59 60 lldb::ValueObjectSP DoCast(const CompilerType &compiler_type) override; 61 62 protected: 63 ValueObjectConstResultImpl m_impl; 64 65 private: 66 friend class ValueObject; 67 friend class ValueObjectConstResult; 68 friend class ValueObjectConstResultImpl; 69 70 ValueObject *CreateChildAtIndex(size_t idx) override { 71 return m_impl.CreateChildAtIndex(idx); 72 } 73 ValueObject *CreateSyntheticArrayMember(size_t idx) override { 74 return m_impl.CreateSyntheticArrayMember(idx); 75 } 76 77 ValueObjectConstResultChild(const ValueObjectConstResultChild &) = delete; 78 const ValueObjectConstResultChild & 79 operator=(const ValueObjectConstResultChild &) = delete; 80 }; 81 82 } // namespace lldb_private 83 84 #endif // LLDB_CORE_VALUEOBJECTCONSTRESULTCHILD_H 85