]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectChild.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / ValueObjectChild.h
1 //===-- ValueObjectChild.h --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_ValueObjectChild_h_
11 #define liblldb_ValueObjectChild_h_
12
13 #include "lldb/Core/ValueObject.h"
14
15 #include "lldb/Symbol/CompilerType.h"
16 #include "lldb/Utility/ConstString.h"
17 #include "lldb/lldb-defines.h"
18 #include "lldb/lldb-enumerations.h"
19 #include "lldb/lldb-private-enumerations.h"
20 #include "lldb/lldb-types.h"
21
22 #include "llvm/ADT/Optional.h"
23
24 #include <stddef.h>
25 #include <stdint.h>
26
27 namespace lldb_private {
28
29 //----------------------------------------------------------------------
30 // A child of another ValueObject.
31 //----------------------------------------------------------------------
32 class ValueObjectChild : public ValueObject {
33 public:
34   ~ValueObjectChild() override;
35
36   uint64_t GetByteSize() override { return m_byte_size; }
37
38   lldb::offset_t GetByteOffset() override { return m_byte_offset; }
39
40   uint32_t GetBitfieldBitSize() override { return m_bitfield_bit_size; }
41
42   uint32_t GetBitfieldBitOffset() override { return m_bitfield_bit_offset; }
43
44   lldb::ValueType GetValueType() const override;
45
46   size_t CalculateNumChildren(uint32_t max) override;
47
48   ConstString GetTypeName() override;
49
50   ConstString GetQualifiedTypeName() override;
51
52   ConstString GetDisplayTypeName() override;
53
54   bool IsInScope() override;
55
56   bool IsBaseClass() override { return m_is_base_class; }
57
58   bool IsDereferenceOfParent() override { return m_is_deref_of_parent; }
59
60 protected:
61   bool UpdateValue() override;
62
63   LazyBool CanUpdateWithInvalidExecutionContext() override;
64
65   CompilerType GetCompilerTypeImpl() override { return m_compiler_type; }
66
67   CompilerType m_compiler_type;
68   ConstString m_type_name;
69   uint64_t m_byte_size;
70   int32_t m_byte_offset;
71   uint8_t m_bitfield_bit_size;
72   uint8_t m_bitfield_bit_offset;
73   bool m_is_base_class;
74   bool m_is_deref_of_parent;
75   llvm::Optional<LazyBool> m_can_update_with_invalid_exe_ctx;
76
77   //
78   //  void
79   //  ReadValueFromMemory (ValueObject* parent, lldb::addr_t address);
80
81 protected:
82   friend class ValueObject;
83   friend class ValueObjectConstResult;
84   friend class ValueObjectConstResultImpl;
85
86   ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type,
87                    const ConstString &name, uint64_t byte_size,
88                    int32_t byte_offset, uint32_t bitfield_bit_size,
89                    uint32_t bitfield_bit_offset, bool is_base_class,
90                    bool is_deref_of_parent,
91                    AddressType child_ptr_or_ref_addr_type,
92                    uint64_t language_flags);
93
94   DISALLOW_COPY_AND_ASSIGN(ValueObjectChild);
95 };
96
97 } // namespace lldb_private
98
99 #endif // liblldb_ValueObjectChild_h_