LLDB mainline
ValueObjectRegister.h
Go to the documentation of this file.
1//===-- ValueObjectRegister.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_VALUEOBJECTREGISTER_H
10#define LLDB_VALUEOBJECT_VALUEOBJECTREGISTER_H
11
16#include "lldb/lldb-defines.h"
18#include "lldb/lldb-forward.h"
20
21#include <cstddef>
22#include <cstdint>
23#include <optional>
24
25namespace lldb_private {
26class DataExtractor;
27class Status;
28class ExecutionContextScope;
29class Scalar;
30class Stream;
31
33public:
35
37 lldb::RegisterContextSP &reg_ctx_sp,
38 uint32_t set_idx);
39
40 std::optional<uint64_t> GetByteSize() override;
41
42 lldb::ValueType GetValueType() const override {
44 }
45
46 ConstString GetTypeName() override;
47
49
50 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
51
53 bool can_create = true) override;
54
55 size_t GetIndexOfChildWithName(llvm::StringRef name) override;
56
57protected:
58 bool UpdateValue() override;
59
61
64 uint32_t m_reg_set_idx;
65
66private:
68
70 ValueObjectManager &manager,
71 lldb::RegisterContextSP &reg_ctx_sp, uint32_t set_idx);
72
73 ValueObject *CreateChildAtIndex(size_t idx) override;
75 return nullptr;
76 }
77
78 // For ValueObject only
82};
83
85public:
87
89 lldb::RegisterContextSP &reg_ctx_sp,
90 const RegisterInfo *reg_info);
91
92 std::optional<uint64_t> GetByteSize() override;
93
94 lldb::ValueType GetValueType() const override {
96 }
97
98 ConstString GetTypeName() override;
99
100 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
101
102 bool SetValueFromCString(const char *value_str, Status &error) override;
103
104 bool SetData(DataExtractor &data, Status &error) override;
105
106 bool ResolveValue(Scalar &scalar) override;
107
108 void
110 GetExpressionPathFormat epformat =
112
113protected:
114 bool UpdateValue() override;
115
117
123
124private:
125 void ConstructObject(const RegisterInfo *reg_info);
126
128
130 const RegisterInfo *reg_info);
132 ValueObjectManager &manager,
133 lldb::RegisterContextSP &reg_ctx_sp,
134 const RegisterInfo *reg_info);
135
136 // For ValueObject only
139};
140
141} // namespace lldb_private
142
143#endif // LLDB_VALUEOBJECT_VALUEOBJECTREGISTER_H
static llvm::raw_ostream & error(Stream &strm)
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
An data extractor class.
Definition: DataExtractor.h:48
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
An error handling class.
Definition: Status.h:115
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
ValueObjectRegisterSet(const ValueObjectRegisterSet &)=delete
std::optional< uint64_t > GetByteSize() override
size_t GetIndexOfChildWithName(llvm::StringRef name) override
lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true) override
lldb::ValueType GetValueType() const override
ValueObject * CreateSyntheticArrayMember(size_t idx) override
Should only be called by ValueObject::GetSyntheticArrayMember().
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP &reg_ctx_sp, uint32_t set_idx)
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
ValueObject * CreateChildAtIndex(size_t idx) override
Should only be called by ValueObject::GetChildAtIndex().
const ValueObjectRegisterSet & operator=(const ValueObjectRegisterSet &)=delete
bool SetValueFromCString(const char *value_str, Status &error) override
bool SetData(DataExtractor &data, Status &error) override
lldb::ValueType GetValueType() const override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP &reg_ctx_sp, const RegisterInfo *reg_info)
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
std::optional< uint64_t > GetByteSize() override
ValueObjectRegister(const ValueObjectRegister &)=delete
lldb::RegisterContextSP m_reg_ctx_sp
const ValueObjectRegister & operator=(const ValueObjectRegister &)=delete
CompilerType GetCompilerTypeImpl() override
void ConstructObject(const RegisterInfo *reg_info)
void GetExpressionPath(Stream &s, GetExpressionPathFormat epformat=eGetExpressionPathFormatDereferencePointers) override
bool ResolveValue(Scalar &scalar) override
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:484
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
Definition: lldb-forward.h:394
@ eValueTypeRegister
stack frame register value
@ eValueTypeRegisterSet
A collection of stack frame register values.
Every register is described in detail including its name, alternate name (optional),...
Registers are grouped into register sets.