27#include "llvm/ADT/StringRef.h"
40#pragma mark ValueObjectRegisterSet
56 :
ValueObject(exe_scope, manager), m_reg_ctx_sp(reg_ctx),
57 m_reg_set(nullptr), m_reg_set_idx(reg_set_idx) {
77llvm::Expected<uint32_t>
82 return reg_count <= max ? reg_count : max;
100 if (reg_set ==
nullptr)
133 if (reg_info !=
nullptr)
137 return valobj->
GetSP();
145 if (reg_info !=
nullptr)
152#pragma mark ValueObjectRegister
167 :
ValueObject(parent), m_reg_ctx_sp(reg_ctx_sp), m_reg_info(),
168 m_reg_value(), m_type_name(), m_compiler_type() {
169 assert(reg_ctx_sp.get());
185 :
ValueObject(exe_scope, manager), m_reg_ctx_sp(reg_ctx), m_reg_info(),
186 m_reg_value(), m_type_name(), m_compiler_type() {
197 if (
auto *exe_module = target->GetExecutableModulePointer()) {
198 auto type_system_or_err =
200 if (
auto err = type_system_or_err.takeError()) {
202 "Unable to get CompilerType from TypeSystem: {0}");
204 if (
auto ts = *type_system_or_err)
220llvm::Expected<uint32_t>
225 return children_count;
226 return *children_count <= max ? *children_count : max;
237 if (frame ==
nullptr) {
270 if (!
error.Success())
274 error.SetErrorString(
"unable to write back to register");
284 if (!
error.Success())
288 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.
ConstString GetTypeName(bool BaseOnly=false) const
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
bool IsEmpty() const
Test for empty string.
"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
ValueObjectRegisterSet(ExecutionContextScope *exe_scope, ValueObjectManager &manager, lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx)
ConstString GetTypeName() override
std::optional< uint64_t > GetByteSize() override
size_t GetIndexOfChildWithName(llvm::StringRef name) override
lldb::RegisterContextSP m_reg_ctx_sp
lldb::ValueObjectSP GetChildMemberWithName(llvm::StringRef name, bool can_create=true) override
bool UpdateValue() override
const RegisterSet * m_reg_set
CompilerType GetCompilerTypeImpl() override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, uint32_t set_idx)
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
ValueObject * CreateChildAtIndex(size_t idx) override
Should only be called by ValueObject::GetChildAtIndex().
~ValueObjectRegisterSet() override
bool SetValueFromCString(const char *value_str, Status &error) override
bool SetData(DataExtractor &data, Status &error) override
~ValueObjectRegister() override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::RegisterContextSP ®_ctx_sp, const RegisterInfo *reg_info)
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
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)
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.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
@ eLanguageTypeC
Non-standardized C, such as K&R.
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
@ eRegisterKindLLDB
lldb's internal register numbers
Every register is described in detail including its name, alternate name (optional),...
lldb::Encoding encoding
Encoding of the register bits.
const char * alt_name
Alternate name of this register, can be NULL.
uint32_t byte_size
Size in bytes of the register.
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
const char * name
Name of this register, can't be NULL.
Registers are grouped into register sets.
size_t num_registers
The number of registers in REGISTERS array below.
const uint32_t * registers
An array of register indices in this set.
const char * name
Name of this register set.