LLDB  mainline
ValueObjectChild.h
Go to the documentation of this file.
1 //===-- ValueObjectChild.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_VALUEOBJECTCHILD_H
10 #define LLDB_CORE_VALUEOBJECTCHILD_H
11 
12 #include "lldb/Core/ValueObject.h"
13 
16 #include "lldb/lldb-defines.h"
17 #include "lldb/lldb-enumerations.h"
19 #include "lldb/lldb-types.h"
20 
21 #include "llvm/ADT/Optional.h"
22 
23 #include <cstddef>
24 #include <cstdint>
25 
26 namespace lldb_private {
27 
28 /// A child of another ValueObject.
29 class ValueObjectChild : public ValueObject {
30 public:
31  ~ValueObjectChild() override;
32 
33  llvm::Optional<uint64_t> GetByteSize() override { return m_byte_size; }
34 
36 
38 
40 
41  lldb::ValueType GetValueType() const override;
42 
43  size_t CalculateNumChildren(uint32_t max) override;
44 
45  ConstString GetTypeName() override;
46 
48 
50 
51  bool IsInScope() override;
52 
53  bool IsBaseClass() override { return m_is_base_class; }
54 
55  bool IsDereferenceOfParent() override { return m_is_deref_of_parent; }
56 
57 protected:
58  bool UpdateValue() override;
59 
61 
63 
66  uint64_t m_byte_size;
67  int32_t m_byte_offset;
72  llvm::Optional<LazyBool> m_can_update_with_invalid_exe_ctx;
73 
74  friend class ValueObject;
75  friend class ValueObjectConstResult;
77 
78  ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type,
79  ConstString name, uint64_t byte_size,
80  int32_t byte_offset, uint32_t bitfield_bit_size,
81  uint32_t bitfield_bit_offset, bool is_base_class,
82  bool is_deref_of_parent,
83  AddressType child_ptr_or_ref_addr_type,
84  uint64_t language_flags);
85 
86  ValueObjectChild(const ValueObjectChild &) = delete;
87  const ValueObjectChild &operator=(const ValueObjectChild &) = delete;
88 };
89 
90 } // namespace lldb_private
91 
92 #endif // LLDB_CORE_VALUEOBJECTCHILD_H
lldb_private::ValueObjectChild::m_byte_size
uint64_t m_byte_size
Definition: ValueObjectChild.h:66
lldb_private::ValueObjectChild::~ValueObjectChild
~ValueObjectChild() override
lldb_private::ValueObjectChild::IsDereferenceOfParent
bool IsDereferenceOfParent() override
Definition: ValueObjectChild.h:55
lldb-defines.h
lldb_private::ValueObjectChild::m_bitfield_bit_size
uint8_t m_bitfield_bit_size
Definition: ValueObjectChild.h:68
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
lldb_private::ValueObjectChild::GetDisplayTypeName
ConstString GetDisplayTypeName() override
Definition: ValueObjectChild.cpp:78
lldb_private::ValueObjectChild::GetTypeName
ConstString GetTypeName() override
Definition: ValueObjectChild.cpp:64
lldb_private::ValueObjectChild::CanUpdateWithInvalidExecutionContext
LazyBool CanUpdateWithInvalidExecutionContext() override
Definition: ValueObjectChild.cpp:84
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
lldb_private::ValueObjectChild::m_compiler_type
CompilerType m_compiler_type
Definition: ValueObjectChild.h:64
lldb_private::LazyBool
LazyBool
Definition: lldb-private-enumerations.h:115
lldb-private-enumerations.h
lldb_private::ValueObjectChild::GetByteSize
llvm::Optional< uint64_t > GetByteSize() override
Definition: ValueObjectChild.h:33
lldb_private::ValueObjectChild::GetValueType
lldb::ValueType GetValueType() const override
Definition: ValueObjectChild.cpp:48
lldb_private::ValueObject::ValueObjectChild
friend class ValueObjectChild
Definition: ValueObject.h:931
lldb_private::ValueObjectChild::m_bitfield_bit_offset
uint8_t m_bitfield_bit_offset
Definition: ValueObjectChild.h:69
lldb_private::ValueObjectChild::GetBitfieldBitOffset
uint32_t GetBitfieldBitOffset() override
Definition: ValueObjectChild.h:39
lldb_private::ValueObjectChild::m_type_name
ConstString m_type_name
Definition: ValueObjectChild.h:65
lldb_private::ValueObjectChild::operator=
const ValueObjectChild & operator=(const ValueObjectChild &)=delete
lldb_private::ConstString
Definition: ConstString.h:40
lldb-enumerations.h
lldb_private::ValueObjectChild::GetQualifiedTypeName
ConstString GetQualifiedTypeName() override
Definition: ValueObjectChild.cpp:72
CompilerType.h
ValueObject.h
lldb-types.h
lldb_private::ValueObjectChild::GetBitfieldBitSize
uint32_t GetBitfieldBitSize() override
Definition: ValueObjectChild.h:37
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb::ValueType
ValueType
Definition: lldb-enumerations.h:315
uint32_t
lldb_private::ValueObjectChild::CalculateNumChildren
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
Definition: ValueObjectChild.cpp:52
lldb_private::ValueObjectChild::IsBaseClass
bool IsBaseClass() override
Definition: ValueObjectChild.h:53
lldb_private::ValueObjectConstResultImpl
A class wrapping common implementation details for operations in ValueObjectConstResult ( & Child ) t...
Definition: ValueObjectConstResultImpl.h:32
lldb_private::ValueObjectChild::UpdateValue
bool UpdateValue() override
Definition: ValueObjectChild.cpp:103
lldb_private::ValueObjectChild::IsInScope
bool IsInScope() override
Definition: ValueObjectChild.cpp:221
lldb_private::ValueObjectConstResult
A frozen ValueObject copied into host memory.
Definition: ValueObjectConstResult.h:33
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::ValueObjectChild::GetCompilerTypeImpl
CompilerType GetCompilerTypeImpl() override
Definition: ValueObjectChild.h:62
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ValueObjectChild::m_can_update_with_invalid_exe_ctx
llvm::Optional< LazyBool > m_can_update_with_invalid_exe_ctx
Definition: ValueObjectChild.h:72
lldb_private::ValueObjectChild::m_is_base_class
bool m_is_base_class
Definition: ValueObjectChild.h:70
ConstString.h
lldb_private::ValueObjectChild
A child of another ValueObject.
Definition: ValueObjectChild.h:29
lldb_private::ValueObjectChild::GetByteOffset
lldb::offset_t GetByteOffset() override
Definition: ValueObjectChild.h:35
lldb_private::ValueObjectChild::m_is_deref_of_parent
bool m_is_deref_of_parent
Definition: ValueObjectChild.h:71
lldb_private::ValueObjectChild::m_byte_offset
int32_t m_byte_offset
Definition: ValueObjectChild.h:67