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_VALUEOBJECT_VALUEOBJECTCONSTRESULTCHILD_H 10 #define LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCHILD_H 11 12 #include "lldb/Symbol/CompilerType.h" 13 #include "lldb/Utility/ConstString.h" 14 #include "lldb/ValueObject/ValueObjectChild.h" 15 #include "lldb/ValueObject/ValueObjectConstResultImpl.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( 32 ValueObject &parent, const CompilerType &compiler_type, ConstString name, 33 uint32_t byte_size, int32_t byte_offset, uint32_t bitfield_bit_size, 34 uint32_t bitfield_bit_offset, bool is_base_class, bool is_deref_of_parent, 35 lldb::addr_t live_address, uint64_t language_flags); 36 37 ~ValueObjectConstResultChild() override; 38 39 lldb::ValueObjectSP Dereference(Status &error) override; 40 GetCompilerType()41 virtual CompilerType GetCompilerType() { 42 return ValueObjectChild::GetCompilerType(); 43 } 44 45 lldb::ValueObjectSP GetSyntheticChildAtOffset( 46 uint32_t offset, const CompilerType &type, bool can_create, 47 ConstString name_const_str = ConstString()) override; 48 49 lldb::ValueObjectSP AddressOf(Status &error) override; 50 51 AddrAndType GetAddressOf(bool scalar_is_load_address = true) override; 52 53 size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0, 54 uint32_t item_count = 1) override; 55 56 lldb::ValueObjectSP DoCast(const CompilerType &compiler_type) override; 57 58 protected: 59 ValueObjectConstResultImpl m_impl; 60 61 private: 62 friend class ValueObject; 63 friend class ValueObjectConstResult; 64 friend class ValueObjectConstResultImpl; 65 CreateChildAtIndex(size_t idx)66 ValueObject *CreateChildAtIndex(size_t idx) override { 67 return m_impl.CreateChildAtIndex(idx); 68 } CreateSyntheticArrayMember(size_t idx)69 ValueObject *CreateSyntheticArrayMember(size_t idx) override { 70 return m_impl.CreateSyntheticArrayMember(idx); 71 } 72 73 ValueObjectConstResultChild(const ValueObjectConstResultChild &) = delete; 74 const ValueObjectConstResultChild & 75 operator=(const ValueObjectConstResultChild &) = delete; 76 }; 77 78 } // namespace lldb_private 79 80 #endif // LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCHILD_H 81