1 //===-- ValueObjectRegister.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ValueObjectRegister_h_
11 #define liblldb_ValueObjectRegister_h_
13 #include "lldb/Core/ValueObject.h"
14 #include "lldb/Symbol/CompilerType.h"
15 #include "lldb/Utility/ConstString.h"
16 #include "lldb/Utility/RegisterValue.h"
17 #include "lldb/lldb-defines.h"
18 #include "lldb/lldb-enumerations.h"
19 #include "lldb/lldb-forward.h"
20 #include "lldb/lldb-private-types.h"
25 namespace lldb_private {
28 namespace lldb_private {
31 namespace lldb_private {
32 class ExecutionContextScope;
34 namespace lldb_private {
37 namespace lldb_private {
41 namespace lldb_private {
43 //----------------------------------------------------------------------
44 // A ValueObject that contains a root variable that may or may not
46 //----------------------------------------------------------------------
47 class ValueObjectRegisterContext : public ValueObject {
49 ~ValueObjectRegisterContext() override;
51 uint64_t GetByteSize() override;
53 lldb::ValueType GetValueType() const override {
54 return lldb::eValueTypeRegisterSet;
57 ConstString GetTypeName() override;
59 ConstString GetQualifiedTypeName() override;
61 ConstString GetDisplayTypeName() override;
63 size_t CalculateNumChildren(uint32_t max) override;
65 ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
66 int32_t synthetic_index) override;
69 bool UpdateValue() override;
71 CompilerType GetCompilerTypeImpl() override;
73 lldb::RegisterContextSP m_reg_ctx_sp;
76 ValueObjectRegisterContext(ValueObject &parent,
77 lldb::RegisterContextSP ®_ctx_sp);
78 //------------------------------------------------------------------
79 // For ValueObject only
80 //------------------------------------------------------------------
81 DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterContext);
84 class ValueObjectRegisterSet : public ValueObject {
86 ~ValueObjectRegisterSet() override;
88 static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
89 lldb::RegisterContextSP ®_ctx_sp,
92 uint64_t GetByteSize() override;
94 lldb::ValueType GetValueType() const override {
95 return lldb::eValueTypeRegisterSet;
98 ConstString GetTypeName() override;
100 ConstString GetQualifiedTypeName() override;
102 size_t CalculateNumChildren(uint32_t max) override;
104 ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
105 int32_t synthetic_index) override;
107 lldb::ValueObjectSP GetChildMemberWithName(const ConstString &name,
108 bool can_create) override;
110 size_t GetIndexOfChildWithName(const ConstString &name) override;
113 bool UpdateValue() override;
115 CompilerType GetCompilerTypeImpl() override;
117 lldb::RegisterContextSP m_reg_ctx_sp;
118 const RegisterSet *m_reg_set;
119 uint32_t m_reg_set_idx;
122 friend class ValueObjectRegisterContext;
124 ValueObjectRegisterSet(ExecutionContextScope *exe_scope,
125 lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx);
127 //------------------------------------------------------------------
128 // For ValueObject only
129 //------------------------------------------------------------------
130 DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterSet);
133 class ValueObjectRegister : public ValueObject {
135 ~ValueObjectRegister() override;
137 static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
138 lldb::RegisterContextSP ®_ctx_sp,
141 uint64_t GetByteSize() override;
143 lldb::ValueType GetValueType() const override {
144 return lldb::eValueTypeRegister;
147 ConstString GetTypeName() override;
149 size_t CalculateNumChildren(uint32_t max) override;
151 bool SetValueFromCString(const char *value_str, Status &error) override;
153 bool SetData(DataExtractor &data, Status &error) override;
155 bool ResolveValue(Scalar &scalar) override;
158 GetExpressionPath(Stream &s, bool qualify_cxx_base_classes,
159 GetExpressionPathFormat epformat =
160 eGetExpressionPathFormatDereferencePointers) override;
163 bool UpdateValue() override;
165 CompilerType GetCompilerTypeImpl() override;
167 lldb::RegisterContextSP m_reg_ctx_sp;
168 RegisterInfo m_reg_info;
169 RegisterValue m_reg_value;
170 ConstString m_type_name;
171 CompilerType m_compiler_type;
174 void ConstructObject(uint32_t reg_num);
176 friend class ValueObjectRegisterSet;
178 ValueObjectRegister(ValueObject &parent, lldb::RegisterContextSP ®_ctx_sp,
180 ValueObjectRegister(ExecutionContextScope *exe_scope,
181 lldb::RegisterContextSP ®_ctx_sp, uint32_t reg_num);
183 //------------------------------------------------------------------
184 // For ValueObject only
185 //------------------------------------------------------------------
186 DISALLOW_COPY_AND_ASSIGN(ValueObjectRegister);
189 } // namespace lldb_private
191 #endif // liblldb_ValueObjectRegister_h_