34#include "llvm/ADT/StringRef.h"
64 m_name = var_sp->GetName();
97llvm::Expected<uint32_t>
102 return llvm::createStringError(
"invalid type");
105 const bool omit_empty_base_classes =
true;
106 auto child_count = type.
GetNumChildren(omit_empty_base_classes, &exe_ctx);
109 return *child_count <= max ? *child_count : max;
158 loclist_base_load_addr =
162 llvm::Expected<Value> maybe_value = expr_list.
Evaluate(
163 &exe_ctx,
nullptr, loclist_base_load_addr,
nullptr,
nullptr);
169 expr_list.
IsImplicit(&exe_ctx,
nullptr, loclist_base_load_addr);
174 m_value.SetCompilerType(compiler_type);
192 if (
size_t value_buf_size =
m_value.GetBuffer().GetByteSize()) {
194 if (
m_error.Success() && value_buf_size < value_size)
195 m_value.ResizeData(value_size);
200 const bool process_is_alive = process && process->
IsAlive();
202 switch (value_type) {
261 const bool process_is_alive = process && process->
IsAlive();
263 const bool is_pointer_or_ref =
264 (type_info & (lldb::eTypeIsPointer | lldb::eTypeIsReference)) != 0;
266 switch (value_type) {
287 if (process_is_alive && is_pointer_or_ref)
298 if (is_pointer_or_ref)
382 if (!reg_info || !reg_ctx) {
416 if (!reg_info || !reg_ctx) {
static llvm::raw_ostream & error(Stream &strm)
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.
ConstString GetDisplayTypeName() const
llvm::Expected< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
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
bool IsImplicit(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t func_load_addr) const
Return true if the expression in scope at the current PC produces an implicit location,...
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.
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 Address & GetAddress() const
Return the address of the function (its entry point).
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.
static Status FromErrorString(const char *str)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
"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()
ConstString GetTypeName() override
ValueObjectVariable(ExecutionContextScope *exe_scope, ValueObjectManager &manager, const lldb::VariableSP &var_sp)
bool CanSetValue() override
Returns false when this value cannot be modified through SetValueFromCString() or SetData() because i...
~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
bool m_resolved_value_is_implicit
True when the resolved value has no writable storage in the inferior (an implicit location,...
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
Value m_resolved_value
The value that DWARFExpression resolves this variable to before we patch it up.
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().
llvm::Expected< uint64_t > GetByteSize() override
bool GetDeclaration(Declaration &decl) override
CompilerType GetCompilerTypeImpl() override
void SetValueIsValid(bool valid)
ClusterManager< ValueObject > ValueObjectManager
ValueObject(ExecutionContextScope *exe_scope, ValueObjectManager &manager, AddressType child_ptr_or_ref_addr_type=eAddressTypeLoad)
Use this constructor to create a "root variable object".
Status m_error
An error object that can describe any errors that occur when updating values.
virtual bool CanSetValue()
Returns false when this value cannot be modified through SetValueFromCString() or SetData() because i...
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)
CompilerType GetCompilerType()
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
See comment on m_scalar to understand what GetScalar returns.
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
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 SetContext(ContextType context_type, void *p)
@ Variable
lldb_private::Variable *.
@ RegisterInfo
RegisterInfo * (can be a scalar or a vector register).
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),...