44 return parent->IsInScope();
79 process_sp->ReadPointerFromMemory(vtable_entry_addr,
m_error);
82 "failed to read virtual function entry 0x%16.16" PRIx64,
97 Address resolved_vfunc_ptr_address;
98 target_sp->ResolveLoadAddress(vfunc_ptr, resolved_vfunc_ptr_address);
99 if (resolved_vfunc_ptr_address.
IsValid())
111 auto type_system = target_sp->GetScratchTypeSystemForLanguage(
115 (*type_system)->CreateGenericFunctionPrototype().GetPointerType());
117 consumeError(type_system.takeError());
125 const bool thread_and_frame_only_if_stopped =
true;
210 LanguageRuntime *language_runtime = process_sp->GetLanguageRuntime(language);
212 if (language_runtime ==
nullptr) {
214 "no language runtime support for the language \"%s\"",
220 llvm::Expected<LanguageRuntime::VTableInfo> vtable_info_or_err =
222 if (!vtable_info_or_err) {
223 m_error = vtable_info_or_err.takeError();
228 const addr_t vtable_start_addr =
229 vtable_info_or_err->addr.GetLoadAddress(target_sp.get());
234 "no vtable symbol found containing 0x%" PRIx64, vtable_start_addr);
244 "vtable symbol \"%s\" doesn't have a valid size",
250 const addr_t vtable_end_addr =
257 auto type_system_or_err =
259 if (type_system_or_err) {
263 consumeError(type_system_or_err.takeError());
ValueObjectVTableChild(ValueObject &parent, uint32_t func_idx, uint64_t addr_size)
const uint64_t m_addr_size
bool IsInScope() override
bool UpdateValue() override
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
ValueObjectVTableChild(const ValueObjectVTableChild &)=delete
~ValueObjectVTableChild() override=default
CompilerType GetCompilerTypeImpl() override
std::optional< uint64_t > GetByteSize() override
const uint32_t m_func_idx
const ValueObjectVTableChild & operator=(const ValueObjectVTableChild &)=delete
ValueType GetValueType() const override
A section + offset based address class.
Function * CalculateSymbolContextFunction() const
bool IsValid() const
Check if the object state is valid.
Generic representation of a type in a programming language.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A class that describes a function.
CompilerType GetCompilerType()
virtual llvm::Expected< VTableInfo > GetVTableInfo(ValueObject &in_value, bool check_type)
Get the vtable information for a given value.
static const char * GetNameForLanguageType(lldb::LanguageType language)
ConstString GetDemangledName() const
Demangled name get accessor.
void Clear()
Clear the object state.
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
bool Fail() const
Test for error condition.
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
bool Success() const
Test for success condition.
lldb::addr_t GetLoadAddress(Target *target) const
bool GetByteSizeIsValid() const
lldb::addr_t GetByteSize() const
ConstString GetName() const
ConstString GetDisplayName() const
A class that represents a virtual function table for a C++ class.
const Symbol * m_vtable_symbol
The symbol for the C++ virtual function table.
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
uint32_t m_addr_size
Cache the address size in bytes to avoid checking with the process to many times.
ConstString GetQualifiedTypeName() override
ValueObject * CreateChildAtIndex(size_t idx) override
Should only be called by ValueObject::GetChildAtIndex().
static lldb::ValueObjectSP Create(ValueObject &parent)
lldb::ValueType GetValueType() const override
ValueObjectVTable(ValueObject &parent)
~ValueObjectVTable() override
std::optional< uint64_t > GetByteSize() override
ConstString GetTypeName() override
uint32_t m_num_vtable_entries
Cache the number of vtable children when we update the value.
ConstString GetDisplayTypeName() override
CompilerType GetCompilerTypeImpl() override
bool IsInScope() override
bool UpdateValue() override
void SetValueIsValid(bool valid)
struct lldb_private::ValueObject::Bitflags m_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 uint64_t GetValueAsUnsigned(uint64_t fail_value, bool *success=nullptr)
void SetValueDidChange(bool value_changed)
virtual lldb::ModuleSP GetModule()
Return the module associated with this value object in case the value is from an executable file and ...
lldb::LanguageType GetObjectRuntimeLanguage()
virtual lldb::addr_t GetAddressOf(bool scalar_is_load_address=true, AddressType *address_type=nullptr)
bool UpdateValueIfNeeded(bool update_format=true)
void SetName(ConstString name)
Change the name of the current ValueObject.
lldb::TargetSP GetTargetSP() const
virtual ValueObject * GetParent()
virtual void SetFormat(lldb::Format format)
const ExecutionContextRef & GetExecutionContextRef() const
const Scalar & GetScalar() const
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
@ LoadAddress
A load address value.
void SetCompilerType(const CompilerType &compiler_type)
void SetValueType(ValueType value_type)
const CompilerType & GetCompilerType()
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
@ eLanguageTypeC_plus_plus
ISO C++:1998.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Target > TargetSP
@ eValueTypeVTableEntry
function pointer in virtual function table
@ eValueTypeVTable
virtual function table
bool m_children_count_valid