/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Core/ValueObjectChild.h
Line | Count | Source |
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 | | |
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" |
20 | | |
21 | | #include <cstddef> |
22 | | #include <cstdint> |
23 | | #include <optional> |
24 | | |
25 | | namespace lldb_private { |
26 | | |
27 | | /// A child of another ValueObject. |
28 | | class ValueObjectChild : public ValueObject { |
29 | | public: |
30 | | ~ValueObjectChild() override; |
31 | | |
32 | 407 | std::optional<uint64_t> GetByteSize() override { return m_byte_size; } |
33 | | |
34 | 92 | lldb::offset_t GetByteOffset() override { return m_byte_offset; } |
35 | | |
36 | 42.2k | uint32_t GetBitfieldBitSize() override { return m_bitfield_bit_size; } |
37 | | |
38 | 13.7k | uint32_t GetBitfieldBitOffset() override { return m_bitfield_bit_offset; } |
39 | | |
40 | | lldb::ValueType GetValueType() const override; |
41 | | |
42 | | size_t CalculateNumChildren(uint32_t max) override; |
43 | | |
44 | | ConstString GetTypeName() override; |
45 | | |
46 | | ConstString GetQualifiedTypeName() override; |
47 | | |
48 | | ConstString GetDisplayTypeName() override; |
49 | | |
50 | | bool IsInScope() override; |
51 | | |
52 | 5.77k | bool IsBaseClass() override { return m_is_base_class; } |
53 | | |
54 | 2.94k | bool IsDereferenceOfParent() override { return m_is_deref_of_parent; } |
55 | | |
56 | | protected: |
57 | | bool UpdateValue() override; |
58 | | |
59 | | LazyBool CanUpdateWithInvalidExecutionContext() override; |
60 | | |
61 | 1.47M | CompilerType GetCompilerTypeImpl() override { return m_compiler_type; } |
62 | | |
63 | | CompilerType m_compiler_type; |
64 | | ConstString m_type_name; |
65 | | uint64_t m_byte_size; |
66 | | int32_t m_byte_offset; |
67 | | uint8_t m_bitfield_bit_size; |
68 | | uint8_t m_bitfield_bit_offset; |
69 | | bool m_is_base_class; |
70 | | bool m_is_deref_of_parent; |
71 | | std::optional<LazyBool> m_can_update_with_invalid_exe_ctx; |
72 | | |
73 | | friend class ValueObject; |
74 | | friend class ValueObjectConstResult; |
75 | | friend class ValueObjectConstResultImpl; |
76 | | |
77 | | ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type, |
78 | | ConstString name, uint64_t byte_size, |
79 | | int32_t byte_offset, uint32_t bitfield_bit_size, |
80 | | uint32_t bitfield_bit_offset, bool is_base_class, |
81 | | bool is_deref_of_parent, |
82 | | AddressType child_ptr_or_ref_addr_type, |
83 | | uint64_t language_flags); |
84 | | |
85 | | ValueObjectChild(const ValueObjectChild &) = delete; |
86 | | const ValueObjectChild &operator=(const ValueObjectChild &) = delete; |
87 | | }; |
88 | | |
89 | | } // namespace lldb_private |
90 | | |
91 | | #endif // LLDB_CORE_VALUEOBJECTCHILD_H |