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 liblldb_ValueObjectRegister_h_
10 #define liblldb_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 <stddef.h>
22 #include <stdint.h>
23 
24 namespace lldb_private {
25 class DataExtractor;
26 }
27 namespace lldb_private {
28 class Status;
29 }
30 namespace lldb_private {
31 class ExecutionContextScope;
32 }
33 namespace lldb_private {
34 class Scalar;
35 }
36 namespace lldb_private {
37 class Stream;
38 }
39 
40 namespace lldb_private {
41 
42 // A ValueObject that contains a root variable that may or may not
43 // have children.
45 public:
46  ~ValueObjectRegisterContext() override;
47 
48  uint64_t GetByteSize() override;
49 
50  lldb::ValueType GetValueType() const override {
52  }
53 
54  ConstString GetTypeName() override;
55 
57 
59 
60  size_t CalculateNumChildren(uint32_t max) override;
61 
62  ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
63  int32_t synthetic_index) override;
64 
65 protected:
66  bool UpdateValue() override;
67 
69 
70  lldb::RegisterContextSP m_reg_ctx_sp;
71 
72 private:
74  lldb::RegisterContextSP &reg_ctx_sp);
75  // For ValueObject only
76  DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterContext);
77 };
78 
80 public:
81  ~ValueObjectRegisterSet() override;
82 
83  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
84  lldb::RegisterContextSP &reg_ctx_sp,
85  uint32_t set_idx);
86 
87  uint64_t GetByteSize() override;
88 
89  lldb::ValueType GetValueType() const override {
91  }
92 
93  ConstString GetTypeName() override;
94 
96 
97  size_t CalculateNumChildren(uint32_t max) override;
98 
99  ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member,
100  int32_t synthetic_index) override;
101 
102  lldb::ValueObjectSP GetChildMemberWithName(ConstString name,
103  bool can_create) override;
104 
105  size_t GetIndexOfChildWithName(ConstString name) override;
106 
107 protected:
108  bool UpdateValue() override;
109 
111 
112  lldb::RegisterContextSP m_reg_ctx_sp;
113  const RegisterSet *m_reg_set;
115 
116 private:
118 
120  lldb::RegisterContextSP &reg_ctx_sp, uint32_t set_idx);
121 
122  // For ValueObject only
123  DISALLOW_COPY_AND_ASSIGN(ValueObjectRegisterSet);
124 };
125 
127 public:
128  ~ValueObjectRegister() override;
129 
130  static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
131  lldb::RegisterContextSP &reg_ctx_sp,
132  uint32_t reg_num);
133 
134  uint64_t GetByteSize() override;
135 
136  lldb::ValueType GetValueType() const override {
138  }
139 
140  ConstString GetTypeName() override;
141 
142  size_t CalculateNumChildren(uint32_t max) override;
143 
144  bool SetValueFromCString(const char *value_str, Status &error) override;
145 
146  bool SetData(DataExtractor &data, Status &error) override;
147 
148  bool ResolveValue(Scalar &scalar) override;
149 
150  void
151  GetExpressionPath(Stream &s, bool qualify_cxx_base_classes,
152  GetExpressionPathFormat epformat =
154 
155 protected:
156  bool UpdateValue() override;
157 
159 
160  lldb::RegisterContextSP m_reg_ctx_sp;
161  RegisterInfo m_reg_info;
165 
166 private:
167  void ConstructObject(uint32_t reg_num);
168 
170 
171  ValueObjectRegister(ValueObject &parent, lldb::RegisterContextSP &reg_ctx_sp,
172  uint32_t reg_num);
174  lldb::RegisterContextSP &reg_ctx_sp, uint32_t reg_num);
175 
176  // For ValueObject only
177  DISALLOW_COPY_AND_ASSIGN(ValueObjectRegister);
178 };
179 
180 } // namespace lldb_private
181 
182 #endif // liblldb_ValueObjectRegister_h_
An data extractor class.
Definition: DataExtractor.h:47
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
virtual lldb::ValueObjectSP GetChildMemberWithName(ConstString name, bool can_create)
lldb::ValueType GetValueType() const override
virtual bool SetValueFromCString(const char *value_str, Status &error)
ValueObject * CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index) override
virtual size_t GetIndexOfChildWithName(ConstString name)
virtual bool SetData(DataExtractor &data, Status &error)
virtual bool ResolveValue(Scalar &scalar)
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
lldb::ValueType GetValueType() const override
A uniqued constant string class.
Definition: ConstString.h:38
virtual void GetExpressionPath(Stream &s, bool qualify_cxx_base_classes, GetExpressionPathFormat=eGetExpressionPathFormatDereferencePointers)
lldb::RegisterContextSP m_reg_ctx_sp
lldb::ValueType GetValueType() const override
size_t CalculateNumChildren(uint32_t max) override
An error handling class.
Definition: Status.h:44