31 ConstString name, uint64_t byte_size, int32_t byte_offset,
32 uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
33 bool is_base_class,
bool is_deref_of_parent,
34 AddressType child_ptr_or_ref_addr_type, uint64_t language_flags)
35 :
ValueObject(parent), m_compiler_type(compiler_type),
36 m_byte_size(byte_size), m_byte_offset(byte_offset),
37 m_bitfield_bit_size(bitfield_bit_size),
38 m_bitfield_bit_offset(bitfield_bit_offset),
39 m_is_base_class(is_base_class), m_is_deref_of_parent(is_deref_of_parent),
40 m_can_update_with_invalid_exe_ctx() {
56 return children_count;
57 return *children_count <= max ? *children_count : max;
61 uint8_t bitfield_bit_size) {
62 if (name && bitfield_bit_size)
63 name.
SetString(llvm::formatv(
"{0}:{1}", name, bitfield_bit_size).str());
77 return qualified_name;
95 if (opinionated_parent)
117 const bool is_instance_ptr_base =
119 (parent_type_flags.
AnySet(lldb::eTypeInstanceIsPointer)));
127 if (process_sp && process_sp->IsAlive())
155 }
else if (addr == 0) {
165 const bool thread_and_frame_only_if_stopped =
true;
167 thread_and_frame_only_if_stopped));
170 uint64_t bitfield_end =
172 if (bitfield_end > *type_bit_size) {
173 uint64_t overhang_bytes =
174 (bitfield_end - *type_bit_size + 7) / 8;
198 const bool thread_and_frame_only_if_stopped =
true;
static void AdjustForBitfieldness(ConstString &name, uint8_t bitfield_bit_size)
Generic representation of a type in a programming language.
ConstString GetDisplayTypeName() const
bool ShouldTreatScalarValueAsAddress() const
ConstString GetTypeName(bool BaseOnly=false) 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.
bool IsEmpty() const
Test for empty string.
void SetString(llvm::StringRef s)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
bool AnySet(ValueType mask) const
Test one or more flags.
unsigned long long ULongLong(unsigned long long fail_value=0) const
bool ExtractBitfield(uint32_t bit_size, uint32_t bit_offset)
void Clear()
Clear the object state.
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
bool Success() const
Test for success condition.
ConstString GetTypeName() override
ConstString GetQualifiedTypeName() override
ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type, ConstString name, uint64_t byte_size, int32_t byte_offset, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool is_base_class, bool is_deref_of_parent, AddressType child_ptr_or_ref_addr_type, uint64_t language_flags)
lldb::ValueType GetValueType() const override
uint8_t m_bitfield_bit_offset
uint8_t m_bitfield_bit_size
bool UpdateValue() override
ConstString GetDisplayTypeName() override
bool IsInScope() override
LazyBool CanUpdateWithInvalidExecutionContext() override
std::optional< LazyBool > m_can_update_with_invalid_exe_ctx
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
~ValueObjectChild() override
void SetValueIsValid(bool valid)
ValueObject * FollowParentChain(std::function< bool(ValueObject *)>)
Given a ValueObject, loop over itself and its parent, and its parent's parent, .
lldb::addr_t GetPointerValue(AddressType *address_type=nullptr)
CompilerType GetCompilerType()
virtual void SetLanguageFlags(uint64_t flags)
Status m_error
An error object that can describe any errors that occur when updating values.
lldb::ProcessSP GetProcessSP() const
DataExtractor m_data
A data extractor that can be used to extract the value.
virtual lldb::ValueType GetValueType() const =0
virtual LazyBool CanUpdateWithInvalidExecutionContext()
virtual lldb::ModuleSP GetModule()
Return the module associated with this value object in case the value is from an executable file and ...
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr)
ValueObject * m_parent
The parent value object, or nullptr if this has no parent.
bool UpdateValueIfNeeded(bool update_format=true)
AddressType GetAddressTypeOfChildren()
const Status & GetError()
ConstString m_name
The name of this object.
const ExecutionContextRef & GetExecutionContextRef() const
const Value & GetValue() const
void SetAddressTypeOfChildren(AddressType at)
const Scalar & GetScalar() const
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
@ 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 SetValueType(ValueType value_type)
#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::Process > ProcessSP