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_VALUEOBJECT_VALUEOBJECTMEMORY_H
10#define LLDB_VALUEOBJECT_VALUEOBJECTMEMORY_H
11
12#include "lldb/Core/Address.h"
16#include "lldb/lldb-defines.h"
18#include "lldb/lldb-forward.h"
19#include "llvm/ADT/StringRef.h"
20
21#include <cstddef>
22#include <cstdint>
23#include <optional>
24
25namespace lldb_private {
27
28/// A ValueObject that represents memory at a given address, viewed as some
29/// set lldb type.
31public:
33
35 llvm::StringRef name,
36 const Address &address,
37 lldb::TypeSP &type_sp,
38 ValueObject *parent = nullptr);
39
41 llvm::StringRef name,
42 const Address &address,
43 const CompilerType &ast_type,
44 ValueObject *parent = nullptr);
45
46 llvm::Expected<uint64_t> GetByteSize() override;
47
48 ConstString GetTypeName() override;
49
51
52 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
53
54 lldb::ValueType GetValueType() const override;
55
56 bool IsInScope() override;
57
58 lldb::ModuleSP GetModule() override;
59
60protected:
61 bool UpdateValue() override;
62
64
65 Address m_address; ///< The variable that this value object is based upon
68
69private:
71 ValueObjectManager &manager, llvm::StringRef name,
72 const Address &address, lldb::TypeSP &type_sp);
73
75 ValueObjectManager &manager, llvm::StringRef name,
76 const Address &address, const CompilerType &ast_type);
77 // For ValueObject only
80};
81
82} // namespace lldb_private
83
84#endif // LLDB_VALUEOBJECT_VALUEOBJECTMEMORY_H
A section + offset based address class.
Definition Address.h:62
Generic representation of a type in a programming language.
A uniqued constant string class.
Definition ConstString.h:40
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp, ValueObject *parent=nullptr)
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
lldb::ValueType GetValueType() const override
llvm::Expected< uint64_t > GetByteSize() override
ValueObjectMemory(const ValueObjectMemory &)=delete
lldb::ModuleSP GetModule() override
Return the module associated with this value object in case the value is from an executable file and ...
const ValueObjectMemory & operator=(const ValueObjectMemory &)=delete
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
ConstString GetDisplayTypeName() override
ClusterManager< ValueObject > ValueObjectManager
ValueObject(ExecutionContextScope *exe_scope, ValueObjectManager &manager, AddressType child_ptr_or_ref_addr_type=eAddressTypeLoad)
Use this constructor to create a "root variable object".
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Module > ModuleSP