40 llvm::StringRef symbol_name =
44 ": static-type = '%s' has vtable symbol '%s'\n",
49 llvm::StringRef class_name = symbol_name;
53 std::string lookup_name(
"::");
54 lookup_name.append(class_name.data(), class_name.size());
64 TypeQueryOptions::e_exact_match |
65 TypeQueryOptions::e_strict_namespaces |
66 TypeQueryOptions::e_find_one);
68 module_sp->FindTypes(query, results);
71 class_types.
Insert(type_sp);
76 if (class_types.
Empty()) {
78 m_process->GetTarget().GetImages().FindTypes(
nullptr, query, results);
80 class_types.
Insert(type_sp);
84 if (class_types.
Empty()) {
85 LLDB_LOGF(log,
"0x%16.16" PRIx64
": is not dynamic\n",
89 if (class_types.
GetSize() == 1) {
93 type_sp->GetForwardCompilerType())) {
96 ": static-type = '%s' has dynamic type: uid={0x%" PRIx64
97 "}, type-name='%s'\n",
100 type_sp->GetName().GetCString());
107 for (i = 0; i < class_types.
GetSize(); i++) {
112 ": static-type = '%s' has multiple matching dynamic "
113 "types: uid={0x%" PRIx64
"}, type-name='%s'\n",
116 type_sp->GetName().GetCString());
121 for (i = 0; i < class_types.
GetSize(); i++) {
125 type_sp->GetForwardCompilerType())) {
127 "0x%16.16" PRIx64
": static-type = '%s' has multiple "
128 "matching dynamic types, picking "
129 "this one: uid={0x%" PRIx64
"}, type-name='%s'\n",
132 type_sp->GetName().GetCString());
140 ": static-type = '%s' has multiple matching dynamic "
141 "types, didn't find a C++ match\n",
171 class_type_or_name =
GetTypeInfo(in_value, vtable_info);
173 if (!class_type_or_name)
195 const uint32_t addr_byte_size =
m_process->GetAddressByteSize();
197 vtable_load_addr - 2 * addr_byte_size;
200 if (offset_to_top_location >= vtable_load_addr)
204 Address(offset_to_top_location), addr_byte_size, INT64_MIN,
error);
206 if (offset_to_top == INT64_MIN)
212 if (!
m_process->GetTarget().ResolveLoadAddress(dynamic_addr,
220 std::vector<const char *> &names,
bool catch_bp,
bool throw_bp,
221 bool for_expressions) {
229 static const char *g_catch_name =
"__cxa_begin_catch";
230 static const char *g_throw_name1 =
"__cxa_throw";
231 static const char *g_throw_name2 =
"__cxa_rethrow";
232 static const char *g_exception_throw_name =
"__cxa_allocate_exception";
235 names.push_back(g_catch_name);
238 names.push_back(g_throw_name1);
239 names.push_back(g_throw_name2);
243 names.push_back(g_exception_throw_name);
260 if (!thread_sp->SafeToCallFunctions())
280 thread_sp->CalculateExecutionContext(exe_ctx);
296 m_process->GetTarget().GetFunctionCallerForLanguage(
301 func_call_ret = function_caller->
ExecuteFunction(exe_ctx,
nullptr, options,
302 diagnostics, results);
307 size_t ptr_size =
m_process->GetAddressByteSize();
312 if (!
error.Success()) {
325 return dyn_exception;
332 std::lock_guard<std::mutex> locker(
m_mutex);
342 std::lock_guard<std::mutex> locker(
m_mutex);
static llvm::raw_ostream & error(Stream &strm)
static const char * vtable_demangled_prefix
#define LLDB_LOGF(log,...)
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
void SetRawAddress(lldb::addr_t addr)
bool IsSectionOffset() const
Check if an address is section offset.
llvm::Triple & GetTriple()
Architecture triple accessor.
Generic representation of a type in a programming language.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
const char * AsCString(const char *value_if_empty) const
Get the string value as a C string.
void SetUnwindOnError(bool unwind=false)
void SetTryAllThreads(bool try_others=true)
void SetTimeout(const Timeout< std::micro > &timeout)
void SetStopOthers(bool stop_others=true)
void SetIgnoreBreakpoints(bool ignore=false)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void EmplaceBack(Args &&...args)
Inserts a new FileSpec into the FileSpecList constructed in-place with the given arguments.
Encapsulates a function that can be called.
lldb::ExpressionResults ExecuteFunction(ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager, Value &results)
Run the function this FunctionCaller was created with.
TypeAndOrName GetDynamicTypeInfo(const lldb_private::Address &vtable_addr)
ItaniumABIRuntime(Process *process)
lldb::ValueObjectSP GetExceptionObjectForThread(lldb::ThreadSP thread_sp)
void AppendExceptionBreakpointFilterModules(FileSpecList &list, const Target &target)
void AppendExceptionBreakpointFunctions(std::vector< const char * > &names, bool catch_bp, bool throw_bp, bool for_expressions)
DynamicTypeCache m_dynamic_type_map
void SetDynamicTypeInfo(const lldb_private::Address &vtable_addr, const TypeAndOrName &type_info)
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, const LanguageRuntime::VTableInfo &vtable_info, TypeAndOrName &class_type_or_name, Address &dynamic_address, Value::ValueType &value_type)
bool IsVTableSymbol(Mangled &manged) const
TypeAndOrName GetTypeInfo(ValueObject &in_value, const LanguageRuntime::VTableInfo &vtable_info)
A class that handles mangled names.
ConstString GetDemangledName() const
Demangled name get accessor.
A collection class for Module objects.
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
A plug-in interface definition class for debugging a process.
unsigned long long ULongLong(unsigned long long fail_value=0) const
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
Defines a list of symbol context objects.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Defines a symbol context baton that can be handed other debug core functions.
Symbol * symbol
The Symbol for a given query.
lldb::ModuleSP CalculateSymbolContextModule() override
Address GetAddress() const
int64_t ReadSignedIntegerFromMemory(const Address &addr, size_t integer_byte_size, int64_t fail_value, Status &error, bool force_live_memory=false)
const ArchSpec & GetArchitecture() const
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
void SetName(ConstString type_name)
CompilerType GetCompilerType() const
void SetTypeSP(lldb::TypeSP type_sp)
void Insert(const lldb::TypeSP &type)
lldb::TypeSP GetTypeAtIndex(uint32_t idx) const
TypeIterable Types() const
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
lldb::TypeSP GetFirstType() const
static bool AreTypesSame(CompilerType type1, CompilerType type2, bool ignore_qualifiers=false)
static bool IsCXXClassType(const CompilerType &type)
virtual ConstString GetTypeName()
CompilerType GetCompilerType()
AddrAndType GetPointerValue()
static lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type, ValueObject *parent=nullptr)
const Scalar & GetScalar() const
See comment on m_scalar to understand what GetScalar returns.
ValueType
Type that describes Value::m_value.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
@ eLanguageTypeC
Non-standardized C, such as K&R.
ExpressionResults
The results of expression evaluation.
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP
std::shared_ptr< lldb_private::Module > ModuleSP
Symbol * symbol
Address of the vtable's virtual function table.