/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/include/lldb/Core/ValueObjectRegister.h
Line | Count | Source (jump to first uncovered line) |
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" |
13 | | #include "lldb/Symbol/CompilerType.h" |
14 | | #include "lldb/Utility/ConstString.h" |
15 | | #include "lldb/Utility/RegisterValue.h" |
16 | | #include "lldb/lldb-defines.h" |
17 | | #include "lldb/lldb-enumerations.h" |
18 | | #include "lldb/lldb-forward.h" |
19 | | #include "lldb/lldb-private-types.h" |
20 | | |
21 | | #include <cstddef> |
22 | | #include <cstdint> |
23 | | #include <optional> |
24 | | |
25 | | namespace lldb_private { |
26 | | class DataExtractor; |
27 | | class Status; |
28 | | class ExecutionContextScope; |
29 | | class Scalar; |
30 | | class Stream; |
31 | | |
32 | | class ValueObjectRegisterSet : public ValueObject { |
33 | | public: |
34 | | ~ValueObjectRegisterSet() override; |
35 | | |
36 | | static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, |
37 | | lldb::RegisterContextSP ®_ctx_sp, |
38 | | uint32_t set_idx); |
39 | | |
40 | | std::optional<uint64_t> GetByteSize() override; |
41 | | |
42 | 0 | lldb::ValueType GetValueType() const override { |
43 | 0 | return lldb::eValueTypeRegisterSet; |
44 | 0 | } |
45 | | |
46 | | ConstString GetTypeName() override; |
47 | | |
48 | | ConstString GetQualifiedTypeName() override; |
49 | | |
50 | | size_t CalculateNumChildren(uint32_t max) override; |
51 | | |
52 | | ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member, |
53 | | int32_t synthetic_index) override; |
54 | | |
55 | | lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, |
56 | | bool can_create = true) override; |
57 | | |
58 | | size_t GetIndexOfChildWithName(llvm::StringRef name) override; |
59 | | |
60 | | protected: |
61 | | bool UpdateValue() override; |
62 | | |
63 | | CompilerType GetCompilerTypeImpl() override; |
64 | | |
65 | | lldb::RegisterContextSP m_reg_ctx_sp; |
66 | | const RegisterSet *m_reg_set; |
67 | | uint32_t m_reg_set_idx; |
68 | | |
69 | | private: |
70 | | friend class ValueObjectRegisterContext; |
71 | | |
72 | | ValueObjectRegisterSet(ExecutionContextScope *exe_scope, |
73 | | ValueObjectManager &manager, |
74 | | lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx); |
75 | | |
76 | | // For ValueObject only |
77 | | ValueObjectRegisterSet(const ValueObjectRegisterSet &) = delete; |
78 | | const ValueObjectRegisterSet & |
79 | | operator=(const ValueObjectRegisterSet &) = delete; |
80 | | }; |
81 | | |
82 | | class ValueObjectRegister : public ValueObject { |
83 | | public: |
84 | | ~ValueObjectRegister() override; |
85 | | |
86 | | static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, |
87 | | lldb::RegisterContextSP ®_ctx_sp, |
88 | | const RegisterInfo *reg_info); |
89 | | |
90 | | std::optional<uint64_t> GetByteSize() override; |
91 | | |
92 | 0 | lldb::ValueType GetValueType() const override { |
93 | 0 | return lldb::eValueTypeRegister; |
94 | 0 | } |
95 | | |
96 | | ConstString GetTypeName() override; |
97 | | |
98 | | size_t CalculateNumChildren(uint32_t max) override; |
99 | | |
100 | | bool SetValueFromCString(const char *value_str, Status &error) override; |
101 | | |
102 | | bool SetData(DataExtractor &data, Status &error) override; |
103 | | |
104 | | bool ResolveValue(Scalar &scalar) override; |
105 | | |
106 | | void |
107 | | GetExpressionPath(Stream &s, |
108 | | GetExpressionPathFormat epformat = |
109 | | eGetExpressionPathFormatDereferencePointers) override; |
110 | | |
111 | | protected: |
112 | | bool UpdateValue() override; |
113 | | |
114 | | CompilerType GetCompilerTypeImpl() override; |
115 | | |
116 | | lldb::RegisterContextSP m_reg_ctx_sp; |
117 | | RegisterInfo m_reg_info; |
118 | | RegisterValue m_reg_value; |
119 | | ConstString m_type_name; |
120 | | CompilerType m_compiler_type; |
121 | | |
122 | | private: |
123 | | void ConstructObject(const RegisterInfo *reg_info); |
124 | | |
125 | | friend class ValueObjectRegisterSet; |
126 | | |
127 | | ValueObjectRegister(ValueObject &parent, lldb::RegisterContextSP ®_ctx_sp, |
128 | | const RegisterInfo *reg_info); |
129 | | ValueObjectRegister(ExecutionContextScope *exe_scope, |
130 | | ValueObjectManager &manager, |
131 | | lldb::RegisterContextSP ®_ctx_sp, |
132 | | const RegisterInfo *reg_info); |
133 | | |
134 | | // For ValueObject only |
135 | | ValueObjectRegister(const ValueObjectRegister &) = delete; |
136 | | const ValueObjectRegister &operator=(const ValueObjectRegister &) = delete; |
137 | | }; |
138 | | |
139 | | } // namespace lldb_private |
140 | | |
141 | | #endif // LLDB_CORE_VALUEOBJECTREGISTER_H |