34#include "llvm/ADT/StringRef.h"
61 :
ValueObject(exe_scope, manager), m_variable_sp(var_sp) {
64 m_name = var_sp->GetName();
97llvm::Expected<uint32_t>
102 return llvm::make_error<llvm::StringError>(
"invalid type",
103 llvm::inconvertibleErrorCode());
106 const bool omit_empty_base_classes =
true;
107 auto child_count = type.
GetNumChildren(omit_empty_base_classes, &exe_ctx);
110 return *child_count <= max ? *child_count : max;
162 loclist_base_load_addr =
167 llvm::Expected<Value> maybe_value = expr_list.
Evaluate(
168 &exe_ctx,
nullptr, loclist_base_load_addr,
nullptr,
nullptr);
203 const bool process_is_alive = process && process->
IsAlive();
205 switch (value_type) {
263 const bool process_is_alive = process && process->
IsAlive();
265 const bool is_pointer_or_ref =
266 (type_info & (lldb::eTypeIsPointer | lldb::eTypeIsReference)) != 0;
268 switch (value_type) {
289 if (process_is_alive && is_pointer_or_ref)
300 if (is_pointer_or_ref)
373 if (!reg_info || !reg_ctx) {
402 if (!reg_info || !reg_ctx) {
static llvm::raw_ostream & error(Stream &strm)
Address & GetBaseAddress()
Get accessor for the base address of the range.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
static std::shared_ptr< ClusterManager > Create()
Generic representation of a type in a programming language.
std::optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
ConstString GetDisplayTypeName() const
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
llvm::Expected< uint32_t > GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
A uniqued constant string class.
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single ...
bool IsAlwaysValidSingleExpr() const
llvm::Expected< Value > Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t func_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr) const
bool GetExpressionData(DataExtractor &data, lldb::addr_t func_load_addr=LLDB_INVALID_ADDRESS, lldb::addr_t file_addr=0) const
Get the expression data at the file address.
lldb::offset_t GetByteSize() const override
Get the number of bytes in the data buffer.
A class that describes the declaration location of a lldb object.
Execution context objects refer to objects in the execution of the program that is being debugged.
bool HasFrameRef() const
Returns true if this object has a weak reference to a frame.
"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.
ExecutionContextScope * GetBestExecutionContextScope() const
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.
RegisterContext * GetRegisterContext() const
const AddressRange & GetAddressRange()
DEPRECATED: Use GetAddressRanges instead.
A plug-in interface definition class for debugging a process.
virtual bool IsAlive()
Check if a process is still alive.
virtual bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue ®_value)=0
Status SetValueFromString(const RegisterInfo *reg_info, llvm::StringRef value_str)
Status SetValueFromData(const RegisterInfo ®_info, DataExtractor &data, lldb::offset_t offset, bool partial_data_ok)
This base class provides an interface to stack frames.
void Clear()
Clear the object state.
static Status FromErrorString(const char *str)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
bool Success() const
Test for success condition.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
virtual lldb::ModuleSP CalculateSymbolContextModule()
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
const ArchSpec & GetArchitecture() const
CompilerType GetForwardCompilerType()
ConstString GetQualifiedName()
A ValueObject that contains a root variable that may or may not have children.
ConstString GetTypeName() override
ValueObjectVariable(ExecutionContextScope *exe_scope, ValueObjectManager &manager, const lldb::VariableSP &var_sp)
~ValueObjectVariable() override
lldb::ValueType GetValueType() const override
SymbolContextScope * GetSymbolContextScope() override
lldb::ModuleSP GetModule() override
Return the module associated with this value object in case the value is from an executable file and ...
void DoUpdateChildrenAddressType(ValueObject &valobj) override
ConstString GetDisplayTypeName() override
bool SetData(DataExtractor &data, Status &error) override
const char * GetLocationAsCString() override
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
std::optional< uint64_t > GetByteSize() override
ConstString GetQualifiedTypeName() override
bool IsInScope() override
bool SetValueFromCString(const char *value_str, Status &error) override
bool UpdateValue() override
lldb::VariableSP m_variable_sp
The variable that this value object is based upon.
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
bool GetDeclaration(Declaration &decl) override
CompilerType GetCompilerTypeImpl() override
void SetValueIsValid(bool valid)
CompilerType GetCompilerType()
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)
virtual const char * GetLocationAsCString()
virtual bool SetValueFromCString(const char *value_str, Status &error)
virtual bool SetData(DataExtractor &data, Status &error)
ConstString m_name
The name of this object.
const char * GetLocationAsCStringImpl(const Value &value, const DataExtractor &data)
const ExecutionContextRef & GetExecutionContextRef() const
virtual bool CanProvideValue()
const Value & GetValue() const
void SetAddressTypeOfChildren(AddressType at)
const Scalar & GetScalar() const
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
RegisterInfo * GetRegisterInfo() const
ValueType
Type that describes Value::m_value.
@ HostAddress
A host address value (for memory in the process that < A is using liblldb).
@ FileAddress
A file address value.
@ LoadAddress
A load address value.
@ Scalar
A raw scalar value.
ValueType GetValueType() const
void SetCompilerType(const CompilerType &compiler_type)
void SetContext(ContextType context_type, void *p)
DataBufferHeap & GetBuffer()
uint64_t GetValueByteSize(Status *error_ptr, ExecutionContext *exe_ctx)
@ Variable
lldb_private::Variable *.
@ RegisterInfo
RegisterInfo * (can be a scalar or a vector register).
ContextType GetContextType() const
void ConvertToLoadAddress(Module *module, Target *target)
Convert this value's file address to a load address, if possible.
size_t ResizeData(size_t len)
void SetBytes(const void *bytes, int len)
DWARFExpressionList & LocationExpressionList()
void CalculateSymbolContext(SymbolContext *sc)
bool GetLocationIsConstantValueData() const
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
@ eAddressTypeHost
Address is an address in the process that is running this code.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Variable > VariableSP
std::shared_ptr< lldb_private::Module > ModuleSP
Every register is described in detail including its name, alternate name (optional),...