27#include "llvm/ADT/StringRef.h"
40#pragma mark ValueObjectRegisterSet
44 lldb::RegisterContextSP ®_ctx_sp,
54 lldb::RegisterContextSP ®_ctx,
56 :
ValueObject(exe_scope, manager), m_reg_ctx_sp(reg_ctx),
57 m_reg_set(nullptr), m_reg_set_idx(reg_set_idx) {
80 auto reg_count = reg_set->num_registers;
81 return reg_count <= max ? reg_count : max;
99 if (reg_set ==
nullptr)
118 size_t idx,
bool synthetic_array_member, int32_t synthetic_index) {
122 if (idx < num_children)
135 const RegisterInfo *reg_info =
137 if (reg_info !=
nullptr)
141 return valobj->
GetSP();
143 return ValueObjectSP();
149 const RegisterInfo *reg_info =
151 if (reg_info !=
nullptr)
158#pragma mark ValueObjectRegister
165 else if (reg_info->alt_name)
171 lldb::RegisterContextSP ®_ctx_sp,
172 const RegisterInfo *reg_info)
173 :
ValueObject(parent), m_reg_ctx_sp(reg_ctx_sp), m_reg_info(),
174 m_reg_value(), m_type_name(), m_compiler_type() {
175 assert(reg_ctx_sp.get());
180 lldb::RegisterContextSP ®_ctx_sp,
181 const RegisterInfo *reg_info) {
189 lldb::RegisterContextSP ®_ctx,
190 const RegisterInfo *reg_info)
191 :
ValueObject(exe_scope, manager), m_reg_ctx_sp(reg_ctx), m_reg_info(),
192 m_reg_value(), m_type_name(), m_compiler_type() {
203 if (
auto *exe_module = target->GetExecutableModulePointer()) {
204 auto type_system_or_err =
206 if (
auto err = type_system_or_err.takeError()) {
208 "Unable to get CompilerType from TypeSystem");
210 if (
auto ts = *type_system_or_err)
229 return children_count <= max ? children_count : max;
240 if (frame ==
nullptr) {
273 if (!
error.Success())
277 error.SetErrorString(
"unable to write back to register");
287 if (!
error.Success())
291 error.SetErrorString(
"unable to write back to register");
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG_ERROR(log, error,...)
static std::shared_ptr< ClusterManager > Create()
Generic representation of a type in a programming language.
uint32_t GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
ConstString GetTypeName(bool BaseOnly=false) const
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
bool IsEmpty() const
Test for empty string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Target * GetTargetPtr() const
Returns a pointer to the target object.
Process * GetProcessPtr() const
Returns a pointer to the process object.
A plug-in interface definition class for debugging a process.
uint32_t GetAddressByteSize() const
bool GetData(DataExtractor &data) const
Status SetValueFromString(const RegisterInfo *reg_info, llvm::StringRef value_str)
bool GetScalarValue(Scalar &scalar) const
Status SetValueFromData(const RegisterInfo ®_info, DataExtractor &data, lldb::offset_t offset, bool partial_data_ok)
This base class provides an interface to stack frames.
lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
void Clear()
Clear the object state.
void SetErrorToGenericError()
Set the current error to a generic error.
bool Success() const
Test for success condition.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
ConstString GetQualifiedTypeName() override
size_t GetIndexOfChildWithName(ConstString name) override
ValueObjectRegisterSet(ExecutionContextScope *exe_scope, ValueObjectManager &manager, lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx)
ConstString GetTypeName() override
std::optional< uint64_t > GetByteSize() override
lldb::RegisterContextSP m_reg_ctx_sp
bool UpdateValue() override
lldb::ValueObjectSP GetChildMemberWithName(ConstString name, bool can_create) override
ValueObject * CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index) override
Should only be called by ValueObject::GetChildAtIndex().
const RegisterSet * m_reg_set
CompilerType GetCompilerTypeImpl() override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx)
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
~ValueObjectRegisterSet() override
bool SetValueFromCString(const char *value_str, Status &error) override
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
bool SetData(DataExtractor &data, Status &error) override
~ValueObjectRegister() override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, const RegisterInfo *reg_info)
std::optional< uint64_t > GetByteSize() override
ValueObjectRegister(ValueObject &parent, lldb::RegisterContextSP ®_ctx_sp, const RegisterInfo *reg_info)
bool UpdateValue() override
ConstString GetTypeName() override
CompilerType m_compiler_type
lldb::RegisterContextSP m_reg_ctx_sp
RegisterValue m_reg_value
CompilerType GetCompilerTypeImpl() override
void ConstructObject(const RegisterInfo *reg_info)
void GetExpressionPath(Stream &s, GetExpressionPathFormat epformat=eGetExpressionPathFormatDereferencePointers) override
bool ResolveValue(Scalar &scalar) override
void Clear(size_t new_count=0)
void SetValueIsValid(bool valid)
size_t GetNumChildren(uint32_t max=UINT32_MAX)
CompilerType GetCompilerType()
lldb::ValueObjectSP GetSP()
ChildrenManager m_children
Status m_error
An error object that can describe any errors that occur when updating values.
DataExtractor m_data
A data extractor that can be used to extract the value.
void SetValueDidChange(bool value_changed)
bool UpdateValueIfNeeded(bool update_format=true)
ConstString m_name
The name of this object.
const ExecutionContextRef & GetExecutionContextRef() const
const Scalar & GetScalar() const
@ HostAddress
A host address value (for memory in the process that < A is using liblldb).
void SetContext(ContextType context_type, void *p)
void SetValueType(ValueType value_type)
@ RegisterInfo
RegisterInfo * (can be a scalar or a vector register).
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
@ eLanguageTypeC
Non-standardized C, such as K&R.
@ eRegisterKindLLDB
lldb's internal register numbers