Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:59

0001 //===-- ValueObjectChild.h --------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_VALUEOBJECT_VALUEOBJECTCHILD_H
0010 #define LLDB_VALUEOBJECT_VALUEOBJECTCHILD_H
0011 
0012 #include "lldb/ValueObject/ValueObject.h"
0013 
0014 #include "lldb/Symbol/CompilerType.h"
0015 #include "lldb/Utility/ConstString.h"
0016 #include "lldb/lldb-defines.h"
0017 #include "lldb/lldb-enumerations.h"
0018 #include "lldb/lldb-private-enumerations.h"
0019 #include "lldb/lldb-types.h"
0020 
0021 #include <cstddef>
0022 #include <cstdint>
0023 #include <optional>
0024 
0025 namespace lldb_private {
0026 
0027 /// A child of another ValueObject.
0028 class ValueObjectChild : public ValueObject {
0029 public:
0030   ~ValueObjectChild() override;
0031 
0032   std::optional<uint64_t> GetByteSize() override { return m_byte_size; }
0033 
0034   lldb::offset_t GetByteOffset() override { return m_byte_offset; }
0035 
0036   uint32_t GetBitfieldBitSize() override { return m_bitfield_bit_size; }
0037 
0038   uint32_t GetBitfieldBitOffset() override { return m_bitfield_bit_offset; }
0039 
0040   lldb::ValueType GetValueType() const override;
0041 
0042   llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
0043 
0044   ConstString GetTypeName() override;
0045 
0046   ConstString GetQualifiedTypeName() override;
0047 
0048   ConstString GetDisplayTypeName() override;
0049 
0050   bool IsInScope() override;
0051 
0052   bool IsBaseClass() override { return m_is_base_class; }
0053 
0054   bool IsDereferenceOfParent() override { return m_is_deref_of_parent; }
0055 
0056 protected:
0057   bool UpdateValue() override;
0058 
0059   LazyBool CanUpdateWithInvalidExecutionContext() override;
0060 
0061   CompilerType GetCompilerTypeImpl() override { return m_compiler_type; }
0062 
0063   CompilerType m_compiler_type;
0064   ConstString m_type_name;
0065   uint64_t m_byte_size;
0066   int32_t m_byte_offset;
0067   uint8_t m_bitfield_bit_size;
0068   uint8_t m_bitfield_bit_offset;
0069   bool m_is_base_class;
0070   bool m_is_deref_of_parent;
0071   std::optional<LazyBool> m_can_update_with_invalid_exe_ctx;
0072 
0073   friend class ValueObject;
0074   friend class ValueObjectConstResult;
0075   friend class ValueObjectConstResultImpl;
0076   friend class ValueObjectVTable;
0077 
0078   ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type,
0079                    ConstString name, uint64_t byte_size, int32_t byte_offset,
0080                    uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
0081                    bool is_base_class, bool is_deref_of_parent,
0082                    AddressType child_ptr_or_ref_addr_type,
0083                    uint64_t language_flags);
0084 
0085   ValueObjectChild(const ValueObjectChild &) = delete;
0086   const ValueObjectChild &operator=(const ValueObjectChild &) = delete;
0087 };
0088 
0089 } // namespace lldb_private
0090 
0091 #endif // LLDB_VALUEOBJECT_VALUEOBJECTCHILD_H