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 <stddef.h>
22 #include <stdint.h>
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  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
A class that represents a running process on the host machine.
lldb::ModuleSP GetModule() override
const ValueObjectMemory & operator=(const ValueObjectMemory &)=delete
size_t CalculateNumChildren(uint32_t max) override
lldb::ValueType GetValueType() const override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
A section + offset based address class.
Definition: Address.h:59
ConstString GetDisplayTypeName() override
ConstString GetTypeName() override
A uniqued constant string class.
Definition: ConstString.h:40
Represents a generic type in a programming language.
Definition: CompilerType.h:33
Address m_address
The variable that this value object is based upon.
ValueObjectMemory(ExecutionContextScope *exe_scope, ValueObjectManager &manager, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
CompilerType GetCompilerTypeImpl() override