LLDB mainline
|
#include <AppleObjCTrampolineHandler.h>
Classes | |
class | AppleObjCVTables |
struct | DispatchFunction |
Public Member Functions | |
AppleObjCTrampolineHandler (const lldb::ProcessSP &process_sp, const lldb::ModuleSP &objc_module_sp) | |
~AppleObjCTrampolineHandler () | |
lldb::ThreadPlanSP | GetStepThroughDispatchPlan (Thread &thread, bool stop_others) |
FunctionCaller * | GetLookupImplementationFunctionCaller () |
bool | AddrIsMsgForward (lldb::addr_t addr) const |
lldb::addr_t | SetupDispatchFunction (Thread &thread, ValueList &dispatch_values) |
const DispatchFunction * | FindDispatchFunction (lldb::addr_t addr) |
void | ForEachDispatchFunction (std::function< void(lldb::addr_t, const DispatchFunction &)>) |
Private Types | |
using | MsgsendMap = std::map< lldb::addr_t, int > |
Private Attributes | |
MsgsendMap | m_msgSend_map |
MsgsendMap | m_opt_dispatch_map |
lldb::ProcessWP | m_process_wp |
lldb::ModuleSP | m_objc_module_sp |
std::string | m_lookup_implementation_function_code |
std::unique_ptr< UtilityFunction > | m_impl_code |
std::mutex | m_impl_function_mutex |
lldb::addr_t | m_impl_fn_addr |
lldb::addr_t | m_impl_stret_fn_addr |
lldb::addr_t | m_msg_forward_addr |
lldb::addr_t | m_msg_forward_stret_addr |
std::unique_ptr< AppleObjCVTables > | m_vtables_up |
Static Private Attributes | |
static const DispatchFunction | g_dispatch_functions [] |
static const char * | g_opt_dispatch_names [] |
static const char * | g_lookup_implementation_function_name |
These hold the code for the function that finds the implementation of an ObjC message send given the class & selector and the kind of dispatch. | |
static const char * | g_lookup_implementation_function_common_code |
static const char * | g_lookup_implementation_with_stret_function_code |
static const char * | g_lookup_implementation_no_stret_function_code |
Definition at line 21 of file AppleObjCTrampolineHandler.h.
|
private |
Definition at line 150 of file AppleObjCTrampolineHandler.h.
AppleObjCTrampolineHandler::AppleObjCTrampolineHandler | ( | const lldb::ProcessSP & | process_sp, |
const lldb::ModuleSP & | objc_module_sp | ||
) |
Definition at line 575 of file AppleObjCTrampolineHandler.cpp.
References lldb_private::ConstString::AsCString(), lldb::eSymbolTypeCode, g_dispatch_functions, g_lookup_implementation_function_common_code, g_lookup_implementation_no_stret_function_code, g_lookup_implementation_with_stret_function_code, g_opt_dispatch_names, lldb_private::Symbol::GetAddress(), lldb_private::Symbol::GetAddressRef(), lldb_private::Address::GetOpcodeLoadAddress(), LLDB_INVALID_ADDRESS, m_impl_fn_addr, m_impl_stret_fn_addr, m_lookup_implementation_function_code, m_msg_forward_addr, m_msg_forward_stret_addr, m_msgSend_map, m_objc_module_sp, m_opt_dispatch_map, m_process_wp, m_vtables_up, and lldb_private::Symbol::ValueIsAddress().
|
default |
|
inline |
Definition at line 33 of file AppleObjCTrampolineHandler.h.
References m_msg_forward_addr, and m_msg_forward_stret_addr.
Referenced by lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop().
const AppleObjCTrampolineHandler::DispatchFunction * AppleObjCTrampolineHandler::FindDispatchFunction | ( | lldb::addr_t | addr | ) |
Definition at line 774 of file AppleObjCTrampolineHandler.cpp.
References g_dispatch_functions, and m_msgSend_map.
Referenced by GetStepThroughDispatchPlan().
void AppleObjCTrampolineHandler::ForEachDispatchFunction | ( | std::function< void(lldb::addr_t, const DispatchFunction &)> | ) |
Definition at line 783 of file AppleObjCTrampolineHandler.cpp.
References g_dispatch_functions, and m_msgSend_map.
Referenced by lldb_private::AppleThreadPlanStepThroughDirectDispatch::AppleThreadPlanStepThroughDirectDispatch().
FunctionCaller * AppleObjCTrampolineHandler::GetLookupImplementationFunctionCaller | ( | ) |
Definition at line 1177 of file AppleObjCTrampolineHandler.cpp.
References m_impl_code.
Referenced by lldb_private::AppleThreadPlanStepThroughObjCTrampoline::InitializeFunctionCaller().
ThreadPlanSP AppleObjCTrampolineHandler::GetStepThroughDispatchPlan | ( | Thread & | thread, |
bool | stop_others | ||
) |
Definition at line 791 of file AppleObjCTrampolineHandler.cpp.
References lldb_private::Thread::CalculateProcess(), lldb_private::Address::CalculateSymbolContextSymbol(), lldb_private::Thread::CalculateTarget(), lldb::eBasicTypeVoid, lldb::eDescriptionLevelFull, lldb::eEncodingSint, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::eFixUpFixed, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::eFixUpNone, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::eFixUpToFix, lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::eOBJC_TRAMPOLINE_STRET, error(), FindDispatchFunction(), lldb_private::AppleObjCTrampolineHandler::DispatchFunction::fixedup, g_opt_dispatch_names, lldb_private::ObjCLanguageRuntime::Get(), lldb_private::ABI::GetArgumentValues(), lldb_private::StreamString::GetData(), lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::GetLog(), lldb_private::Symbol::GetName(), lldb_private::CompilerType::GetPointerType(), lldb_private::Thread::GetProcess(), lldb_private::Thread::GetRegisterContext(), lldb_private::Value::GetScalar(), lldb_private::Thread::GetStackFrameAtIndex(), lldb_private::ConstString::GetStringRef(), lldb_private::ValueList::GetValueAtIndex(), lldb_private::Log::GetVerbose(), lldb_private::AppleObjCTrampolineHandler::DispatchFunction::is_super, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::is_super2, lldb_private::Scalar::IsValid(), LLDB_INVALID_ADDRESS, LLDB_LOG, LLDB_LOGF, lldb_private::Value::LoadAddress, lldb_private::ObjCLanguageRuntime::LookupInMethodCache(), m_opt_dispatch_map, m_vtables_up, lldb_private::ValueList::PushValue(), lldb_private::Target::ResolveLoadAddress(), lldb_private::Value::ResolveValue(), lldb_private::Value::Scalar, lldb_private::Value::SetCompilerType(), lldb_private::Value::SetValueType(), lldb_private::Step, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::stret_return, and lldb_private::Scalar::ULongLong().
lldb::addr_t AppleObjCTrampolineHandler::SetupDispatchFunction | ( | Thread & | thread, |
ValueList & | dispatch_values | ||
) |
Definition at line 699 of file AppleObjCTrampolineHandler.cpp.
References lldb_private::Target::CreateUtilityFunction(), lldb_private::DiagnosticManager::Dump(), lldb::eBasicTypeVoid, lldb::eLanguageTypeC, error(), g_lookup_implementation_function_name, lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::GetLog(), lldb_private::CompilerType::GetPointerType(), lldb_private::Thread::GetProcess(), lldb_private::ExecutionContext::GetTargetRef(), LLDB_INVALID_ADDRESS, LLDB_LOG_ERROR, LLDB_LOGF, m_impl_code, m_impl_function_mutex, m_lookup_implementation_function_code, lldb_private::Step, and lldb_private::FunctionCaller::WriteFunctionArguments().
Referenced by lldb_private::AppleThreadPlanStepThroughObjCTrampoline::InitializeFunctionCaller().
|
staticprivate |
Definition at line 147 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), FindDispatchFunction(), and ForEachDispatchFunction().
|
staticprivate |
Definition at line 64 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler().
|
staticprivate |
These hold the code for the function that finds the implementation of an ObjC message send given the class & selector and the kind of dispatch.
There are two variants depending on whether the platform uses a separate _stret passing convention (e.g. Intel) or not (e.g. ARM). The difference is only at the very end of the function, so the code is broken into the common prefix and the suffix, which get composed appropriately before the function gets compiled.
Definition at line 63 of file AppleObjCTrampolineHandler.h.
Referenced by SetupDispatchFunction().
|
staticprivate |
Definition at line 66 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler().
|
staticprivate |
Definition at line 65 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler().
|
staticprivate |
Definition at line 148 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), and GetStepThroughDispatchPlan().
|
private |
Definition at line 158 of file AppleObjCTrampolineHandler.h.
Referenced by GetLookupImplementationFunctionCaller(), and SetupDispatchFunction().
|
private |
Definition at line 160 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler().
|
private |
Definition at line 159 of file AppleObjCTrampolineHandler.h.
Referenced by SetupDispatchFunction().
|
private |
Definition at line 161 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler().
|
private |
Definition at line 157 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), and SetupDispatchFunction().
|
private |
Definition at line 162 of file AppleObjCTrampolineHandler.h.
Referenced by AddrIsMsgForward(), and AppleObjCTrampolineHandler().
|
private |
Definition at line 163 of file AppleObjCTrampolineHandler.h.
Referenced by AddrIsMsgForward(), and AppleObjCTrampolineHandler().
|
private |
Definition at line 153 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), FindDispatchFunction(), and ForEachDispatchFunction().
|
private |
Definition at line 156 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), and lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols().
|
private |
Definition at line 154 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), and GetStepThroughDispatchPlan().
|
private |
Definition at line 155 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler().
|
private |
Definition at line 164 of file AppleObjCTrampolineHandler.h.
Referenced by AppleObjCTrampolineHandler(), and GetStepThroughDispatchPlan().