LLDB  mainline
ValueObjectMemory.h
Go to the documentation of this file.
1 //===-- ValueObjectMemory.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_VALUEOBJECTMEMORY_H
10 #define LLDB_CORE_VALUEOBJECTMEMORY_H
11 
12 #include "lldb/Core/Address.h"
13 #include "lldb/Core/ValueObject.h"
16 #include "lldb/lldb-defines.h"
17 #include "lldb/lldb-enumerations.h"
18 #include "lldb/lldb-forward.h"
19 #include "llvm/ADT/StringRef.h"
20 
21 #include <cstddef>
22 #include <cstdint>
23 
24 namespace lldb_private {
25 class ExecutionContextScope;
26 
27 /// A ValueObject that represents memory at a given address, viewed as some
28 /// set lldb type.
30 public:
31  ~ValueObjectMemory() override;
32 
33  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
34  llvm::StringRef name,
35  const Address &address,
36  lldb::TypeSP &type_sp);
37 
38  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
39  llvm::StringRef name,
40  const Address &address,
41  const CompilerType &ast_type);
42 
43  llvm::Optional<uint64_t> GetByteSize() override;
44 
45  ConstString GetTypeName() override;
46 
48 
49  size_t CalculateNumChildren(uint32_t max) override;
50 
51  lldb::ValueType GetValueType() const override;
52 
53  bool IsInScope() override;
54 
55  lldb::ModuleSP GetModule() override;
56 
57 protected:
58  bool UpdateValue() override;
59 
61 
62  Address m_address; ///< The variable that this value object is based upon
63  lldb::TypeSP m_type_sp;
65 
66 private:
68  ValueObjectManager &manager, llvm::StringRef name,
69  const Address &address, lldb::TypeSP &type_sp);
70 
72  ValueObjectManager &manager, llvm::StringRef name,
73  const Address &address, const CompilerType &ast_type);
74  // For ValueObject only
75  ValueObjectMemory(const ValueObjectMemory &) = delete;
76  const ValueObjectMemory &operator=(const ValueObjectMemory &) = delete;
77 };
78 
79 } // namespace lldb_private
80 
81 #endif // LLDB_CORE_VALUEOBJECTMEMORY_H
lldb_private::ValueObjectMemory::m_address
Address m_address
The variable that this value object is based upon.
Definition: ValueObjectMemory.h:62
lldb-defines.h
lldb_private::ClusterManager
Definition: SharedCluster.h:22
lldb_private::ValueObjectMemory::GetModule
lldb::ModuleSP GetModule() override
Return the module associated with this value object in case the value is from an executable file and ...
Definition: ValueObjectMemory.cpp:232
lldb_private::ValueObjectMemory::GetValueType
lldb::ValueType GetValueType() const override
Definition: ValueObjectMemory.cpp:149
lldb_private::ValueObjectMemory::IsInScope
bool IsInScope() override
Definition: ValueObjectMemory.cpp:226
lldb_private::ValueObjectMemory::Create
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
Definition: ValueObjectMemory.cpp:31
lldb_private::ValueObjectMemory::GetByteSize
llvm::Optional< uint64_t > GetByteSize() override
Definition: ValueObjectMemory.cpp:142
lldb_private::ValueObjectMemory::CalculateNumChildren
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
Definition: ValueObjectMemory.cpp:129
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::ValueObjectMemory::GetDisplayTypeName
ConstString GetDisplayTypeName() override
Definition: ValueObjectMemory.cpp:123
lldb_private::ValueObjectMemory::GetCompilerTypeImpl
CompilerType GetCompilerTypeImpl() override
Definition: ValueObjectMemory.cpp:111
lldb_private::ConstString
Definition: ConstString.h:40
lldb-enumerations.h
lldb_private::ValueObjectMemory::ValueObjectMemory
ValueObjectMemory(ExecutionContextScope *exe_scope, ValueObjectManager &manager, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
Definition: ValueObjectMemory.cpp:50
lldb_private::ValueObjectMemory::m_compiler_type
CompilerType m_compiler_type
Definition: ValueObjectMemory.h:64
lldb_private::ValueObjectMemory::operator=
const ValueObjectMemory & operator=(const ValueObjectMemory &)=delete
lldb_private::ValueObjectMemory::m_type_sp
lldb::TypeSP m_type_sp
Definition: ValueObjectMemory.h:63
CompilerType.h
Address.h
ValueObject.h
lldb_private::ValueObjectMemory::~ValueObjectMemory
~ValueObjectMemory() override
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb::ValueType
ValueType
Definition: lldb-enumerations.h:315
uint32_t
lldb_private::Address
Definition: Address.h:59
lldb_private::ValueObjectMemory
A ValueObject that represents memory at a given address, viewed as some set lldb type.
Definition: ValueObjectMemory.h:29
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb-forward.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
ConstString.h
lldb_private::ValueObjectMemory::UpdateValue
bool UpdateValue() override
Definition: ValueObjectMemory.cpp:154
lldb_private::ValueObjectMemory::GetTypeName
ConstString GetTypeName() override
Definition: ValueObjectMemory.cpp:117