Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- ValueObjectMemory.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_VALUEOBJECTMEMORY_H
0010 #define LLDB_VALUEOBJECT_VALUEOBJECTMEMORY_H
0011 
0012 #include "lldb/Core/Address.h"
0013 #include "lldb/Symbol/CompilerType.h"
0014 #include "lldb/Utility/ConstString.h"
0015 #include "lldb/ValueObject/ValueObject.h"
0016 #include "lldb/lldb-defines.h"
0017 #include "lldb/lldb-enumerations.h"
0018 #include "lldb/lldb-forward.h"
0019 #include "llvm/ADT/StringRef.h"
0020 
0021 #include <cstddef>
0022 #include <cstdint>
0023 #include <optional>
0024 
0025 namespace lldb_private {
0026 class ExecutionContextScope;
0027 
0028 /// A ValueObject that represents memory at a given address, viewed as some
0029 /// set lldb type.
0030 class ValueObjectMemory : public ValueObject {
0031 public:
0032   ~ValueObjectMemory() override;
0033 
0034   static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
0035                                     llvm::StringRef name,
0036                                     const Address &address,
0037                                     lldb::TypeSP &type_sp);
0038 
0039   static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
0040                                     llvm::StringRef name,
0041                                     const Address &address,
0042                                     const CompilerType &ast_type);
0043 
0044   std::optional<uint64_t> GetByteSize() override;
0045 
0046   ConstString GetTypeName() override;
0047 
0048   ConstString GetDisplayTypeName() override;
0049 
0050   llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
0051 
0052   lldb::ValueType GetValueType() const override;
0053 
0054   bool IsInScope() override;
0055 
0056   lldb::ModuleSP GetModule() override;
0057 
0058 protected:
0059   bool UpdateValue() override;
0060 
0061   CompilerType GetCompilerTypeImpl() override;
0062 
0063   Address m_address; ///< The variable that this value object is based upon
0064   lldb::TypeSP m_type_sp;
0065   CompilerType m_compiler_type;
0066 
0067 private:
0068   ValueObjectMemory(ExecutionContextScope *exe_scope,
0069                     ValueObjectManager &manager, llvm::StringRef name,
0070                     const Address &address, lldb::TypeSP &type_sp);
0071 
0072   ValueObjectMemory(ExecutionContextScope *exe_scope,
0073                     ValueObjectManager &manager, llvm::StringRef name,
0074                     const Address &address, const CompilerType &ast_type);
0075   // For ValueObject only
0076   ValueObjectMemory(const ValueObjectMemory &) = delete;
0077   const ValueObjectMemory &operator=(const ValueObjectMemory &) = delete;
0078 };
0079 
0080 } // namespace lldb_private
0081 
0082 #endif // LLDB_VALUEOBJECT_VALUEOBJECTMEMORY_H