29 SetName(llvm::formatv(
"[{0}]", func_idx).str());
44 return parent->IsInScope();
76 parent_addr = process_sp->FixCodeAddress(parent_addr);
81 process_sp->ReadPointerFromMemory(vtable_entry_addr,
m_error);
84 "failed to read virtual function entry 0x%16.16" PRIx64,
89 vfunc_ptr = process_sp->FixCodeAddress(vfunc_ptr);
94 m_value.GetScalar() = vtable_entry_addr;
100 Address resolved_vfunc_ptr_address;
101 target_sp->ResolveLoadAddress(vfunc_ptr, resolved_vfunc_ptr_address);
102 if (resolved_vfunc_ptr_address.
IsValid())
114 auto type_system = target_sp->GetScratchTypeSystemForLanguage(
118 (*type_system)->CreateGenericFunctionPrototype().GetPointerType());
120 consumeError(type_system.takeError());
128 const bool thread_and_frame_only_if_stopped =
true;
139 return m_value.GetCompilerType();
164 return llvm::createStringError(
"no symbol for vtable");
197 m_flags.m_children_count_valid =
false;
213 LanguageRuntime *language_runtime = process_sp->GetLanguageRuntime(language);
215 if (language_runtime ==
nullptr) {
217 "no language runtime support for the language \"%s\"",
223 llvm::Expected<LanguageRuntime::VTableInfo> vtable_info_or_err =
225 if (!vtable_info_or_err) {
231 const addr_t vtable_start_addr =
232 vtable_info_or_err->addr.GetLoadAddress(target_sp.get());
237 "no vtable symbol found containing 0x%" PRIx64, vtable_start_addr);
247 "vtable symbol \"%s\" doesn't have a valid size",
253 const addr_t vtable_end_addr =
260 auto type_system_or_err =
262 if (type_system_or_err) {
266 consumeError(type_system_or_err.takeError());
ValueObjectVTableChild(ValueObject &parent, uint32_t func_idx, uint64_t addr_size)
const uint64_t m_addr_size
llvm::Expected< uint64_t > GetByteSize() override
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
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.
"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)
Returns the internal LLDB name for the specified language.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
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
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
llvm::Expected< uint64_t > GetByteSize() override
void SetValueIsValid(bool valid)
struct lldb_private::ValueObject::Bitflags m_flags
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.
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()
void SetName(llvm::StringRef name)
Change the name of the current ValueObject.
bool UpdateValueIfNeeded(bool update_format=true)
lldb::TargetSP GetTargetSP() const
virtual ValueObject * GetParent()
virtual void SetFormat(lldb::Format format)
const ExecutionContextRef & GetExecutionContextRef() const
virtual AddrAndType GetAddressOf(bool scalar_is_load_address=true)
@ LoadAddress
A load address value.
#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
@ eValueTypeVTableEntry
function pointer in virtual function table
@ eValueTypeVTable
virtual function table
std::shared_ptr< lldb_private::Target > TargetSP