1 //===-- ValueObjectChild.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_ValueObjectChild_h_
10 #define liblldb_ValueObjectChild_h_
12 #include "lldb/Core/ValueObject.h"
14 #include "lldb/Symbol/CompilerType.h"
15 #include "lldb/Utility/ConstString.h"
16 #include "lldb/lldb-defines.h"
17 #include "lldb/lldb-enumerations.h"
18 #include "lldb/lldb-private-enumerations.h"
19 #include "lldb/lldb-types.h"
21 #include "llvm/ADT/Optional.h"
26 namespace lldb_private {
28 // A child of another ValueObject.
29 class ValueObjectChild : public ValueObject {
31 ~ValueObjectChild() override;
33 uint64_t GetByteSize() override { return m_byte_size; }
35 lldb::offset_t GetByteOffset() override { return m_byte_offset; }
37 uint32_t GetBitfieldBitSize() override { return m_bitfield_bit_size; }
39 uint32_t GetBitfieldBitOffset() override { return m_bitfield_bit_offset; }
41 lldb::ValueType GetValueType() const override;
43 size_t CalculateNumChildren(uint32_t max) override;
45 ConstString GetTypeName() override;
47 ConstString GetQualifiedTypeName() override;
49 ConstString GetDisplayTypeName() override;
51 bool IsInScope() override;
53 bool IsBaseClass() override { return m_is_base_class; }
55 bool IsDereferenceOfParent() override { return m_is_deref_of_parent; }
58 bool UpdateValue() override;
60 LazyBool CanUpdateWithInvalidExecutionContext() override;
62 CompilerType GetCompilerTypeImpl() override { return m_compiler_type; }
64 CompilerType m_compiler_type;
65 ConstString m_type_name;
67 int32_t m_byte_offset;
68 uint8_t m_bitfield_bit_size;
69 uint8_t m_bitfield_bit_offset;
71 bool m_is_deref_of_parent;
72 llvm::Optional<LazyBool> m_can_update_with_invalid_exe_ctx;
76 // ReadValueFromMemory (ValueObject* parent, lldb::addr_t address);
79 friend class ValueObject;
80 friend class ValueObjectConstResult;
81 friend class ValueObjectConstResultImpl;
83 ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type,
84 ConstString name, uint64_t byte_size,
85 int32_t byte_offset, uint32_t bitfield_bit_size,
86 uint32_t bitfield_bit_offset, bool is_base_class,
87 bool is_deref_of_parent,
88 AddressType child_ptr_or_ref_addr_type,
89 uint64_t language_flags);
91 DISALLOW_COPY_AND_ASSIGN(ValueObjectChild);
94 } // namespace lldb_private
96 #endif // liblldb_ValueObjectChild_h_