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"
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 {
26class ExecutionContextScope;
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
40 llvm::StringRef name,
41 const Address &address,
42 const CompilerType &ast_type);
43
44 std::optional<uint64_t> GetByteSize() override;
45
46 ConstString GetTypeName() override;
47
49
50 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
51
52 lldb::ValueType GetValueType() const override;
53
54 bool IsInScope() override;
55
56 lldb::ModuleSP GetModule() override;
57
58protected:
59 bool UpdateValue() override;
60
62
63 Address m_address; ///< The variable that this value object is based upon
66
67private:
69 ValueObjectManager &manager, llvm::StringRef name,
70 const Address &address, lldb::TypeSP &type_sp);
71
73 ValueObjectManager &manager, llvm::StringRef name,
74 const Address &address, const CompilerType &ast_type);
75 // For ValueObject only
78};
79
80} // namespace lldb_private
81
82#endif // LLDB_CORE_VALUEOBJECTMEMORY_H
A section + offset based address class.
Definition: Address.h:62
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
A ValueObject that represents memory at a given address, viewed as some set lldb type.
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, llvm::StringRef name, const Address &address, lldb::TypeSP &type_sp)
lldb::ValueType GetValueType() const 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
std::optional< uint64_t > GetByteSize() override
Address m_address
The variable that this value object is based upon.
CompilerType GetCompilerTypeImpl() override
ConstString GetTypeName() override
ConstString GetDisplayTypeName() override
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:472
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:449
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:365