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_CORE_VALUEOBJECTREGISTER_H
10 #define LLDB_CORE_VALUEOBJECTREGISTER_H
11 
12 #include "lldb/Core/ValueObject.h"
16 #include "lldb/lldb-defines.h"
17 #include "lldb/lldb-enumerations.h"
18 #include "lldb/lldb-forward.h"
20 
21 #include <cstddef>
22 #include <cstdint>
23 
24 namespace lldb_private {
25 class DataExtractor;
26 class Status;
27 class ExecutionContextScope;
28 class Scalar;
29 class Stream;
30 
32 public:
33  ~ValueObjectRegisterSet() override;
34 
35  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
36  lldb::RegisterContextSP &reg_ctx_sp,
37  uint32_t set_idx);
38 
39  llvm::Optional<uint64_t> GetByteSize() override;
40 
41  lldb::ValueType GetValueType() const override {
43  }
44 
45  ConstString GetTypeName() override;
46 
48 
49  size_t CalculateNumChildren(uint32_t max) override;
50 
51  ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
52  int32_t synthetic_index) override;
53 
54  lldb::ValueObjectSP GetChildMemberWithName(ConstString name,
55  bool can_create) override;
56 
57  size_t GetIndexOfChildWithName(ConstString name) override;
58 
59 protected:
60  bool UpdateValue() override;
61 
63 
64  lldb::RegisterContextSP m_reg_ctx_sp;
65  const RegisterSet *m_reg_set;
67 
68 private:
70 
72  ValueObjectManager &manager,
73  lldb::RegisterContextSP &reg_ctx_sp, uint32_t set_idx);
74 
75  // For ValueObject only
78  operator=(const ValueObjectRegisterSet &) = delete;
79 };
80 
82 public:
83  ~ValueObjectRegister() override;
84 
85  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
86  lldb::RegisterContextSP &reg_ctx_sp,
87  const RegisterInfo *reg_info);
88 
89  llvm::Optional<uint64_t> GetByteSize() override;
90 
91  lldb::ValueType GetValueType() const override {
93  }
94 
95  ConstString GetTypeName() override;
96 
97  size_t CalculateNumChildren(uint32_t max) override;
98 
99  bool SetValueFromCString(const char *value_str, Status &error) override;
100 
101  bool SetData(DataExtractor &data, Status &error) override;
102 
103  bool ResolveValue(Scalar &scalar) override;
104 
105  void
107  GetExpressionPathFormat epformat =
109 
110 protected:
111  bool UpdateValue() override;
112 
114 
115  lldb::RegisterContextSP m_reg_ctx_sp;
116  RegisterInfo m_reg_info;
120 
121 private:
122  void ConstructObject(const RegisterInfo *reg_info);
123 
125 
126  ValueObjectRegister(ValueObject &parent, lldb::RegisterContextSP &reg_ctx_sp,
127  const RegisterInfo *reg_info);
129  ValueObjectManager &manager,
130  lldb::RegisterContextSP &reg_ctx_sp,
131  const RegisterInfo *reg_info);
132 
133  // For ValueObject only
134  ValueObjectRegister(const ValueObjectRegister &) = delete;
135  const ValueObjectRegister &operator=(const ValueObjectRegister &) = delete;
136 };
137 
138 } // namespace lldb_private
139 
140 #endif // LLDB_CORE_VALUEOBJECTREGISTER_H
lldb_private::ValueObjectRegisterSet::operator=
const ValueObjectRegisterSet & operator=(const ValueObjectRegisterSet &)=delete
lldb_private::ValueObjectRegisterSet::GetTypeName
ConstString GetTypeName() override
Definition: ValueObjectRegister.cpp:69
lldb-private-types.h
lldb_private::ValueObjectRegisterSet::CalculateNumChildren
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
Definition: ValueObjectRegister.cpp:75
lldb_private::ValueObjectRegister
Definition: ValueObjectRegister.h:81
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::ValueObjectRegister::m_type_name
ConstString m_type_name
Definition: ValueObjectRegister.h:118
lldb-defines.h
lldb_private::Scalar
Definition: Scalar.h:34
lldb_private::ClusterManager
Definition: SharedCluster.h:22
lldb_private::ValueObjectRegister::Create
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP &reg_ctx_sp, const RegisterInfo *reg_info)
Definition: ValueObjectRegister.cpp:177
lldb_private::ValueObjectRegister::GetValueType
lldb::ValueType GetValueType() const override
Definition: ValueObjectRegister.h:91
lldb_private::ValueObjectRegisterSet::GetQualifiedTypeName
ConstString GetQualifiedTypeName() override
Definition: ValueObjectRegister.cpp:71
lldb_private::ValueObjectRegister::UpdateValue
bool UpdateValue() override
Definition: ValueObjectRegister.cpp:235
lldb_private::ValueObjectRegisterSet::m_reg_ctx_sp
lldb::RegisterContextSP m_reg_ctx_sp
Definition: ValueObjectRegister.h:64
lldb_private::ValueObjectRegister::operator=
const ValueObjectRegister & operator=(const ValueObjectRegister &)=delete
RegisterValue.h
lldb_private::ValueObjectRegister::SetData
bool SetData(DataExtractor &data, Status &error) override
Definition: ValueObjectRegister.cpp:282
lldb::eValueTypeRegisterSet
@ eValueTypeRegisterSet
A collection of stack frame register values.
Definition: lldb-enumerations.h:322
lldb_private::Stream
Definition: Stream.h:28
lldb_private::ValueObjectRegisterSet::~ValueObjectRegisterSet
~ValueObjectRegisterSet() override
lldb_private::ValueObject::GetExpressionPathFormat
GetExpressionPathFormat
Definition: ValueObject.h:107
lldb_private::ValueObjectRegister::ValueObjectRegister
ValueObjectRegister(ValueObject &parent, lldb::RegisterContextSP &reg_ctx_sp, const RegisterInfo *reg_info)
Definition: ValueObjectRegister.cpp:168
lldb_private::ValueObjectRegisterSet
Definition: ValueObjectRegister.h:31
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::ValueObjectRegister::m_reg_info
RegisterInfo m_reg_info
Definition: ValueObjectRegister.h:116
lldb_private::ValueObjectRegisterSet::GetIndexOfChildWithName
size_t GetIndexOfChildWithName(ConstString name) override
Definition: ValueObjectRegister.cpp:145
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::ValueObjectRegisterSet::CreateChildAtIndex
ValueObject * CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index) override
Should only be called by ValueObject::GetChildAtIndex().
Definition: ValueObjectRegister.cpp:115
lldb_private::ValueObjectRegister::SetValueFromCString
bool SetValueFromCString(const char *value_str, Status &error) override
Definition: ValueObjectRegister.cpp:267
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::ValueObjectRegister::~ValueObjectRegister
~ValueObjectRegister() override
lldb_private::ValueObjectRegisterSet::m_reg_set
const RegisterSet * m_reg_set
Definition: ValueObjectRegister.h:65
lldb_private::ValueObjectRegister::GetTypeName
ConstString GetTypeName() override
Definition: ValueObjectRegister.cpp:219
lldb_private::ValueObjectRegisterSet::ValueObjectRegisterContext
friend class ValueObjectRegisterContext
Definition: ValueObjectRegister.h:69
lldb-enumerations.h
lldb_private::ValueObjectRegister::ResolveValue
bool ResolveValue(Scalar &scalar) override
Definition: ValueObjectRegister.cpp:294
lldb_private::ValueObjectRegisterSet::ValueObjectRegisterSet
ValueObjectRegisterSet(ExecutionContextScope *exe_scope, ValueObjectManager &manager, lldb::RegisterContextSP &reg_ctx_sp, uint32_t set_idx)
Definition: ValueObjectRegister.cpp:50
CompilerType.h
lldb_private::ValueObjectRegisterSet::m_reg_set_idx
uint32_t m_reg_set_idx
Definition: ValueObjectRegister.h:66
ValueObject.h
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb::ValueType
ValueType
Definition: lldb-enumerations.h:315
lldb_private::ValueObjectRegister::m_reg_ctx_sp
lldb::RegisterContextSP m_reg_ctx_sp
Definition: ValueObjectRegister.h:115
uint32_t
lldb_private::ValueObjectRegister::GetCompilerTypeImpl
CompilerType GetCompilerTypeImpl() override
Definition: ValueObjectRegister.cpp:197
lldb_private::ValueObject::eGetExpressionPathFormatDereferencePointers
@ eGetExpressionPathFormatDereferencePointers
Definition: ValueObject.h:108
lldb_private::ValueObjectRegisterSet::GetChildMemberWithName
lldb::ValueObjectSP GetChildMemberWithName(ConstString name, bool can_create) override
Definition: ValueObjectRegister.cpp:129
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb-forward.h
lldb_private::ValueObjectRegister::m_compiler_type
CompilerType m_compiler_type
Definition: ValueObjectRegister.h:119
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ValueObjectRegisterSet::UpdateValue
bool UpdateValue() override
Definition: ValueObjectRegister.cpp:86
ConstString.h
lldb_private::ValueObjectRegister::GetByteSize
llvm::Optional< uint64_t > GetByteSize() override
Definition: ValueObjectRegister.cpp:231
lldb::eValueTypeRegister
@ eValueTypeRegister
stack frame register value
Definition: lldb-enumerations.h:321
lldb_private::ValueObjectRegisterSet::GetByteSize
llvm::Optional< uint64_t > GetByteSize() override
Definition: ValueObjectRegister.cpp:84
lldb_private::ValueObjectRegister::GetExpressionPath
void GetExpressionPath(Stream &s, GetExpressionPathFormat epformat=eGetExpressionPathFormatDereferencePointers) override
Definition: ValueObjectRegister.cpp:301
lldb_private::ValueObjectRegister::CalculateNumChildren
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
Definition: ValueObjectRegister.cpp:225
lldb_private::LineStatus::Status
@ Status
lldb_private::ValueObjectRegisterSet::Create
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP &reg_ctx_sp, uint32_t set_idx)
Definition: ValueObjectRegister.cpp:41
lldb_private::ValueObjectRegisterSet::GetValueType
lldb::ValueType GetValueType() const override
Definition: ValueObjectRegister.h:41
lldb_private::ValueObjectRegister::ConstructObject
void ConstructObject(const RegisterInfo *reg_info)
Definition: ValueObjectRegister.cpp:158
lldb_private::ValueObjectRegisterSet::GetCompilerTypeImpl
CompilerType GetCompilerTypeImpl() override
Definition: ValueObjectRegister.cpp:65
lldb_private::ValueObjectRegister::m_reg_value
RegisterValue m_reg_value
Definition: ValueObjectRegister.h:117