LLDB mainline
|
#include <JITLoaderGDB.h>
Public Member Functions | |
JITLoaderGDB (lldb_private::Process *process) | |
~JITLoaderGDB () override | |
llvm::StringRef | GetPluginName () override |
void | DidAttach () override |
Called after attaching a process. | |
void | DidLaunch () override |
Called after launching a process. | |
void | ModulesDidLoad (lldb_private::ModuleList &module_list) override |
Called after a new shared object has been loaded so that it can be probed for JIT entry point hooks. | |
Public Member Functions inherited from lldb_private::JITLoader | |
JITLoader (Process *process) | |
Construct with a process. | |
~JITLoader () override | |
virtual void | DidAttach ()=0 |
Called after attaching a process. | |
virtual void | DidLaunch ()=0 |
Called after launching a process. | |
virtual void | ModulesDidLoad (lldb_private::ModuleList &module_list)=0 |
Called after a new shared object has been loaded so that it can be probed for JIT entry point hooks. | |
Public Member Functions inherited from lldb_private::PluginInterface | |
PluginInterface ()=default | |
virtual | ~PluginInterface ()=default |
virtual llvm::StringRef | GetPluginName ()=0 |
PluginInterface (const PluginInterface &)=delete | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
static void | Initialize () |
static void | Terminate () |
static llvm::StringRef | GetPluginNameStatic () |
static llvm::StringRef | GetPluginDescriptionStatic () |
static lldb::JITLoaderSP | CreateInstance (lldb_private::Process *process, bool force) |
static void | DebuggerInitialize (lldb_private::Debugger &debugger) |
Static Public Member Functions inherited from lldb_private::JITLoader | |
static void | LoadPlugins (Process *process, lldb_private::JITLoaderList &list) |
Find a JIT loader plugin for a given process. | |
Private Types | |
typedef std::map< lldb::addr_t, const lldb::ModuleSP > | JITObjectMap |
Private Member Functions | |
lldb::addr_t | GetSymbolAddress (lldb_private::ModuleList &module_list, lldb_private::ConstString name, lldb::SymbolType symbol_type) const |
void | SetJITBreakpoint (lldb_private::ModuleList &module_list) |
bool | DidSetJITBreakpoint () const |
bool | ReadJITDescriptor (bool all_entries) |
template<typename ptr_t > | |
bool | ReadJITDescriptorImpl (bool all_entries) |
Static Private Member Functions | |
static bool | JITDebugBreakpointHit (void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) |
static void | ProcessStateChangedCallback (void *baton, lldb_private::Process *process, lldb::StateType state) |
Private Attributes | |
JITObjectMap | m_jit_objects |
lldb::user_id_t | m_jit_break_id |
lldb::addr_t | m_jit_descriptor_addr |
Additional Inherited Members | |
Protected Attributes inherited from lldb_private::JITLoader | |
Process * | m_process |
Definition at line 17 of file JITLoaderGDB.h.
|
private |
Definition at line 71 of file JITLoaderGDB.h.
JITLoaderGDB::JITLoaderGDB | ( | lldb_private::Process * | process | ) |
Definition at line 146 of file JITLoaderGDB.cpp.
|
override |
Definition at line 151 of file JITLoaderGDB.cpp.
References lldb_private::Process::GetTarget(), LLDB_BREAK_ID_IS_VALID, m_jit_break_id, lldb_private::JITLoader::m_process, and lldb_private::Target::RemoveBreakpointByID().
|
static |
Definition at line 404 of file JITLoaderGDB.cpp.
References lldb_private::Target::GetArchitecture(), GetGlobalPluginProperties(), lldb_private::Process::GetTarget(), and lldb_private::ArchSpec::GetTriple().
Referenced by Initialize(), and Terminate().
|
static |
Definition at line 156 of file JITLoaderGDB.cpp.
References lldb_private::PluginManager::CreateSettingForJITLoaderPlugin(), GetGlobalPluginProperties(), and lldb_private::PluginManager::GetSettingForJITLoaderPlugin().
Referenced by Initialize().
|
overridevirtual |
Called after attaching a process.
Allow JITLoader plug-ins to execute some code after attaching to a process.
Implements lldb_private::JITLoader.
Definition at line 166 of file JITLoaderGDB.cpp.
References lldb_private::Target::GetImages(), lldb_private::Process::GetTarget(), lldb_private::JITLoader::m_process, and SetJITBreakpoint().
|
overridevirtual |
Called after launching a process.
Allow JITLoader plug-ins to execute some code after the process has stopped for the first time on launch.
Implements lldb_private::JITLoader.
Definition at line 172 of file JITLoaderGDB.cpp.
References lldb_private::Target::GetImages(), lldb_private::Process::GetTarget(), lldb_private::JITLoader::m_process, and SetJITBreakpoint().
|
private |
Definition at line 439 of file JITLoaderGDB.cpp.
References LLDB_BREAK_ID_IS_VALID, and m_jit_break_id.
Referenced by ModulesDidLoad(), and SetJITBreakpoint().
|
static |
Definition at line 424 of file JITLoaderGDB.cpp.
Referenced by Initialize().
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 38 of file JITLoaderGDB.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 28 of file JITLoaderGDB.h.
Referenced by GetPluginName(), and Initialize().
|
private |
Definition at line 443 of file JITLoaderGDB.cpp.
References lldb_private::ModuleList::FindSymbolsWithNameAndType(), lldb_private::Symbol::GetAddress(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::Address::GetLoadAddress(), lldb_private::Process::GetTarget(), lldb_private::SymbolContextList::IsEmpty(), lldb_private::Address::IsValid(), LLDB_INVALID_ADDRESS, lldb_private::JITLoader::m_process, and lldb_private::SymbolContext::symbol.
Referenced by SetJITBreakpoint().
|
static |
Definition at line 429 of file JITLoaderGDB.cpp.
References CreateInstance(), DebuggerInitialize(), GetPluginDescriptionStatic(), GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
|
staticprivate |
Definition at line 216 of file JITLoaderGDB.cpp.
References lldb_private::GetLog(), LLDB_LOGF, and ReadJITDescriptor().
Referenced by SetJITBreakpoint().
|
overridevirtual |
Called after a new shared object has been loaded so that it can be probed for JIT entry point hooks.
Implements lldb_private::JITLoader.
Definition at line 178 of file JITLoaderGDB.cpp.
References DidSetJITBreakpoint(), lldb_private::Process::IsAlive(), lldb_private::JITLoader::m_process, and SetJITBreakpoint().
|
staticprivate |
|
private |
Definition at line 272 of file JITLoaderGDB.cpp.
References lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), lldb_private::Process::GetTarget(), and lldb_private::JITLoader::m_process.
Referenced by JITDebugBreakpointHit(), and SetJITBreakpoint().
|
private |
Definition at line 280 of file JITLoaderGDB.cpp.
References lldb_private::ModuleList::Append(), lldb_private::ModuleList::AppendIfNeeded(), error(), lldb_private::ObjectFile::eTypeJIT, lldb_private::Target::GetImages(), lldb_private::GetLog(), lldb_private::SectionList::GetSectionAtIndex(), lldb_private::ObjectFile::GetSectionList(), lldb_private::Target::GetSectionLoadList(), lldb_private::SectionList::GetSize(), lldb_private::Process::GetTarget(), LLDB_INVALID_ADDRESS, LLDB_LOGF, m_jit_descriptor_addr, m_jit_objects, lldb_private::JITLoader::m_process, lldb_private::Target::ModulesDidLoad(), ReadJITEntry(), lldb_private::Process::ReadMemory(), lldb_private::Process::ReadModuleFromMemory(), lldb_private::ModuleList::Remove(), lldb_private::SectionLoadList::SetSectionUnloaded(), and updateSectionLoadAddress().
|
private |
Definition at line 184 of file JITLoaderGDB.cpp.
References lldb_private::Target::CreateBreakpoint(), DidSetJITBreakpoint(), lldb::eSymbolTypeCode, lldb::eSymbolTypeData, lldb_private::Stoppoint::GetID(), lldb_private::GetLog(), GetSymbolAddress(), lldb_private::Process::GetTarget(), JITDebugBreakpointHit(), LLDB_INVALID_ADDRESS, LLDB_LOGF, m_jit_break_id, m_jit_descriptor_addr, lldb_private::JITLoader::m_process, ReadJITDescriptor(), lldb_private::Breakpoint::SetBreakpointKind(), and lldb_private::Breakpoint::SetCallback().
Referenced by DidAttach(), DidLaunch(), and ModulesDidLoad().
|
static |
Definition at line 435 of file JITLoaderGDB.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
private |
Definition at line 74 of file JITLoaderGDB.h.
Referenced by DidSetJITBreakpoint(), SetJITBreakpoint(), and ~JITLoaderGDB().
|
private |
Definition at line 75 of file JITLoaderGDB.h.
Referenced by ReadJITDescriptorImpl(), and SetJITBreakpoint().
|
private |
Definition at line 72 of file JITLoaderGDB.h.
Referenced by ReadJITDescriptorImpl().