|
LLDB mainline
|
#include <DynamicLoaderDarwinKernel.h>
Public Types | |
| typedef std::vector< KextImageInfo > | collection |
| typedef collection::iterator | iterator |
| typedef collection::const_iterator | const_iterator |
Public Member Functions | |
| KextImageInfo () | |
| void | Clear () |
| bool | LoadImageAtFileAddress (lldb_private::Process *process) |
| bool | PrepareSearch (lldb_private::Process *process, std::optional< lldb_private::SymbolLocator::Request > &request) |
| Determine what the search for this binary needs: its UUID, and whether the Target or the shared module list already has it. | |
| bool | LoadLocatedImage (lldb_private::Process *process, std::optional< llvm::Expected< lldb_private::SymbolLocator::Result > > located) |
| Add the module to the Target and set its load addresses. | |
| bool | LoadImageUsingMemoryModule (lldb_private::Process *process) |
| Load this binary on its own: PrepareSearch, then the search, then LoadLocatedImage. | |
| void | FindKernel (lldb_private::Target &target, lldb_private::ModuleSpec module_spec) |
| Searches for the kernel and sets the module, without SymbolLocator. | |
| bool | IsLoaded () |
| void | SetLoadAddress (lldb::addr_t load_addr) |
| lldb::addr_t | GetLoadAddress () const |
| lldb_private::UUID | GetUUID () const |
| void | SetUUID (const lldb_private::UUID &uuid) |
| void | SetName (const char *) |
| std::string | GetName () const |
| void | SetModule (lldb::ModuleSP module) |
| lldb::ModuleSP | GetModule () |
| bool | ReadMemoryModule (lldb_private::Process *process) |
| bool | IsKernel () const |
| void | SetIsKernel (bool is_kernel) |
| uint64_t | GetSize () const |
| void | SetSize (uint64_t size) |
| uint32_t | GetProcessStopId () const |
| void | SetProcessStopId (uint32_t stop_id) |
| bool | operator== (const KextImageInfo &rhs) const |
| uint32_t | GetAddressByteSize () |
| lldb::ByteOrder | GetByteOrder () |
| lldb_private::ArchSpec | GetArchitecture () const |
| void | PutToLog (lldb_private::Log *log) const |
Private Attributes | |
| std::string | m_name |
| lldb::ModuleSP | m_module_sp |
| lldb::ModuleSP | m_memory_module_sp |
| uint32_t | m_load_process_stop_id |
| lldb_private::UUID | m_uuid |
| lldb::addr_t | m_load_address = LLDB_INVALID_ADDRESS |
| uint64_t | m_size = 0 |
| bool | m_kernel_image |
Definition at line 127 of file DynamicLoaderDarwinKernel.h.
| typedef std::vector<KextImageInfo> DynamicLoaderDarwinKernel::KextImageInfo::collection |
Definition at line 223 of file DynamicLoaderDarwinKernel.h.
| typedef collection::const_iterator DynamicLoaderDarwinKernel::KextImageInfo::const_iterator |
Definition at line 225 of file DynamicLoaderDarwinKernel.h.
| typedef collection::iterator DynamicLoaderDarwinKernel::KextImageInfo::iterator |
Definition at line 224 of file DynamicLoaderDarwinKernel.h.
|
inline |
Definition at line 129 of file DynamicLoaderDarwinKernel.h.
References m_memory_module_sp, m_module_sp, m_name, and m_uuid.
Referenced by operator==().
|
inline |
Definition at line 131 of file DynamicLoaderDarwinKernel.h.
References LLDB_INVALID_ADDRESS, m_load_address, m_load_process_stop_id, m_memory_module_sp, m_module_sp, m_name, m_size, m_uuid, and UINT32_MAX.
Referenced by DynamicLoaderDarwinKernel::ParseKextSummaries().
| void DynamicLoaderDarwinKernel::KextImageInfo::FindKernel | ( | lldb_private::Target & | target, |
| lldb_private::ModuleSpec | module_spec ) |
Searches for the kernel and sets the module, without SymbolLocator.
Definition at line 813 of file DynamicLoaderDarwinKernel.cpp.
References lldb_private::Status::AsCString(), lldb_private::PluginManager::DownloadObjectAndSymbolFile(), lldb_private::Status::Fail(), lldb_private::Target::GetArchitecture(), lldb_private::Debugger::GetAsyncErrorStream(), lldb_private::Target::GetDebugger(), lldb_private::ModuleSpec::GetFileSpec(), lldb_private::Target::GetOrCreateModule(), lldb_private::Target::GetPlatform(), lldb_private::FileSystem::Instance(), and m_module_sp.
Referenced by LoadImageUsingMemoryModule().
| uint32_t DynamicLoaderDarwinKernel::KextImageInfo::GetAddressByteSize | ( | ) |
Definition at line 1067 of file DynamicLoaderDarwinKernel.cpp.
References m_memory_module_sp, and m_module_sp.
| lldb_private::ArchSpec DynamicLoaderDarwinKernel::KextImageInfo::GetArchitecture | ( | ) | const |
Definition at line 1084 of file DynamicLoaderDarwinKernel.cpp.
References m_memory_module_sp, and m_module_sp.
| lldb::ByteOrder DynamicLoaderDarwinKernel::KextImageInfo::GetByteOrder | ( | ) |
Definition at line 1075 of file DynamicLoaderDarwinKernel.cpp.
References lldb_private::endian::InlHostByteOrder(), m_memory_module_sp, and m_module_sp.
| addr_t DynamicLoaderDarwinKernel::KextImageInfo::GetLoadAddress | ( | ) | const |
Definition at line 604 of file DynamicLoaderDarwinKernel.cpp.
References m_load_address.
Referenced by operator==(), and DynamicLoaderDarwinKernel::ParseKextSummaries().
| ModuleSP DynamicLoaderDarwinKernel::KextImageInfo::GetModule | ( | ) |
Definition at line 595 of file DynamicLoaderDarwinKernel.cpp.
References m_module_sp.
Referenced by DynamicLoaderDarwinKernel::ParseKextSummaries().
| std::string DynamicLoaderDarwinKernel::KextImageInfo::GetName | ( | ) | const |
Definition at line 638 of file DynamicLoaderDarwinKernel.cpp.
References m_name.
Referenced by operator==(), and DynamicLoaderDarwinKernel::ParseKextSummaries().
| uint32_t DynamicLoaderDarwinKernel::KextImageInfo::GetProcessStopId | ( | ) | const |
Definition at line 616 of file DynamicLoaderDarwinKernel.cpp.
References m_load_process_stop_id.
Referenced by DynamicLoaderDarwinKernel::ParseKextSummaries().
| uint64_t DynamicLoaderDarwinKernel::KextImageInfo::GetSize | ( | ) | const |
Definition at line 608 of file DynamicLoaderDarwinKernel.cpp.
References m_size.
| UUID DynamicLoaderDarwinKernel::KextImageInfo::GetUUID | ( | ) | const |
Definition at line 646 of file DynamicLoaderDarwinKernel.cpp.
References m_uuid.
Referenced by operator==(), and DynamicLoaderDarwinKernel::ParseKextSummaries().
| bool DynamicLoaderDarwinKernel::KextImageInfo::IsKernel | ( | ) | const |
Definition at line 725 of file DynamicLoaderDarwinKernel.cpp.
References m_kernel_image.
Referenced by LoadImageUsingMemoryModule(), LoadLocatedImage(), DynamicLoaderDarwinKernel::ParseKextSummaries(), and PrepareSearch().
|
inline |
Definition at line 175 of file DynamicLoaderDarwinKernel.h.
References m_load_process_stop_id, and UINT32_MAX.
Referenced by LoadImageAtFileAddress(), LoadImageUsingMemoryModule(), LoadLocatedImage(), DynamicLoaderDarwinKernel::ParseKextSummaries(), and PrepareSearch().
| bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageAtFileAddress | ( | lldb_private::Process * | process | ) |
Definition at line 577 of file DynamicLoaderDarwinKernel.cpp.
References lldb_private::Process::GetStopID(), lldb_private::Process::GetTarget(), IsLoaded(), m_load_process_stop_id, and m_module_sp.
Referenced by DynamicLoaderDarwinKernel::ParseKextSummaries().
| bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule | ( | lldb_private::Process * | process | ) |
Load this binary on its own: PrepareSearch, then the search, then LoadLocatedImage.
Definition at line 854 of file DynamicLoaderDarwinKernel.cpp.
References FindKernel(), lldb_private::TargetProperties::GetDebugFileSearchPaths(), lldb_private::Process::GetTarget(), IsKernel(), IsLoaded(), LoadLocatedImage(), lldb_private::SymbolLocator::Locate(), and PrepareSearch().
| bool DynamicLoaderDarwinKernel::KextImageInfo::LoadLocatedImage | ( | lldb_private::Process * | process, |
| std::optional< llvm::Expected< lldb_private::SymbolLocator::Result > > | located ) |
Add the module to the Target and set its load addresses.
The order of the calls determines the order of the Target's modules.
| located | The search result, or empty if PrepareSearch requested no search. |
Definition at line 877 of file DynamicLoaderDarwinKernel.cpp.
References lldb_private::ModuleList::Append(), lldb_private::ModuleList::AppendIfNeeded(), lldb_private::DynamicLoader, lldb_private::ModuleList::FindModule(), lldb_private::SectionList::FindSectionByName(), lldb_private::Debugger::GetAsyncOutputStream(), lldb_private::ObjectFile::GetBaseAddress(), lldb_private::Target::GetDebugger(), lldb_private::Address::GetFileAddress(), lldb_private::Section::GetFileAddress(), lldb_private::Target::GetImages(), lldb_private::GetLog(), lldb_private::Target::GetOrCreateModule(), lldb_private::SectionList::GetSectionAtIndex(), lldb_private::ObjectFile::GetSectionList(), lldb_private::SectionList::GetSize(), lldb_private::Process::GetStopID(), lldb_private::Process::GetTarget(), IsKernel(), IsLoaded(), LLDB_INVALID_ADDRESS, LLDB_LOGF, m_load_address, m_load_process_stop_id, m_memory_module_sp, m_module_sp, m_name, m_uuid, lldb_private::Target::ModulesDidLoad(), ReadMemoryModule(), lldb_private::Target::SetSectionLoadAddress(), and lldb_private::ModuleSpec::SetTarget().
Referenced by LoadImageUsingMemoryModule(), and DynamicLoaderDarwinKernel::ParseKextSummaries().
| bool DynamicLoaderDarwinKernel::KextImageInfo::operator== | ( | const KextImageInfo & | rhs | ) | const |
Definition at line 625 of file DynamicLoaderDarwinKernel.cpp.
References GetLoadAddress(), GetName(), GetUUID(), lldb_private::UUID::IsValid(), KextImageInfo(), m_load_address, m_name, and m_uuid.
| bool DynamicLoaderDarwinKernel::KextImageInfo::PrepareSearch | ( | lldb_private::Process * | process, |
| std::optional< lldb_private::SymbolLocator::Request > & | request ) |
Determine what the search for this binary needs: its UUID, and whether the Target or the shared module list already has it.
For the kernel, the UUID is read from process memory and any kernel with a different UUID is removed from the Target.
| request | Set to the search to run, or left empty if none is needed. |
Definition at line 749 of file DynamicLoaderDarwinKernel.cpp.
References lldb_private::ModuleList::Append(), lldb_private::DynamicLoader, lldb_private::ModuleList::FindModule(), lldb_private::ModuleList::FindSharedModule(), lldb_private::Debugger::GetAsyncOutputStream(), lldb_private::Target::GetDebugger(), lldb_private::Target::GetImages(), lldb_private::GetLog(), lldb_private::Target::GetPlatform(), GetProgressDetail(), lldb_private::Process::GetTarget(), is_kernel(), IsKernel(), IsLoaded(), LLDB_LOGF, m_load_address, m_module_sp, m_name, m_uuid, lldb_private::ModuleList::Modules(), ReadMemoryModule(), and lldb_private::ModuleList::Remove().
| void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog | ( | lldb_private::Log * | log | ) | const |
Definition at line 1606 of file DynamicLoaderDarwinKernel.cpp.
References LLDB_INVALID_ADDRESS, LLDB_LOG, m_load_address, m_name, m_size, and m_uuid.
| bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule | ( | lldb_private::Process * | process | ) |
Definition at line 656 of file DynamicLoaderDarwinKernel.cpp.
References lldb_private::GetLog(), lldb_private::Process::GetTarget(), lldb_private::Host, is_kernel(), LLDB_INVALID_ADDRESS, LLDB_LOG_ERROR, LLDB_LOGF, m_kernel_image, m_load_address, m_memory_module_sp, m_name, m_uuid, DynamicLoaderDarwinKernel::ReadMachHeader(), lldb_private::Process::ReadModuleFromMemory(), and lldb_private::Target::SetArchitecture().
Referenced by LoadLocatedImage(), and PrepareSearch().
| void DynamicLoaderDarwinKernel::KextImageInfo::SetIsKernel | ( | bool | is_kernel | ) |
Definition at line 729 of file DynamicLoaderDarwinKernel.cpp.
References is_kernel(), and m_kernel_image.
| void DynamicLoaderDarwinKernel::KextImageInfo::SetLoadAddress | ( | lldb::addr_t | load_addr | ) |
Definition at line 599 of file DynamicLoaderDarwinKernel.cpp.
References m_load_address.
| void DynamicLoaderDarwinKernel::KextImageInfo::SetModule | ( | lldb::ModuleSP | module | ) |
Definition at line 590 of file DynamicLoaderDarwinKernel.cpp.
References is_kernel(), m_kernel_image, and m_module_sp.
| void DynamicLoaderDarwinKernel::KextImageInfo::SetName | ( | const char * | name | ) |
Definition at line 634 of file DynamicLoaderDarwinKernel.cpp.
References m_name.
| void DynamicLoaderDarwinKernel::KextImageInfo::SetProcessStopId | ( | uint32_t | stop_id | ) |
Definition at line 620 of file DynamicLoaderDarwinKernel.cpp.
References m_load_process_stop_id.
| void DynamicLoaderDarwinKernel::KextImageInfo::SetSize | ( | uint64_t | size | ) |
Definition at line 612 of file DynamicLoaderDarwinKernel.cpp.
References m_size.
| void DynamicLoaderDarwinKernel::KextImageInfo::SetUUID | ( | const lldb_private::UUID & | uuid | ) |
Definition at line 642 of file DynamicLoaderDarwinKernel.cpp.
References m_uuid.
|
private |
Definition at line 238 of file DynamicLoaderDarwinKernel.h.
Referenced by IsKernel(), ReadMemoryModule(), SetIsKernel(), and SetModule().
|
private |
Definition at line 236 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), GetLoadAddress(), LoadLocatedImage(), operator==(), PrepareSearch(), PutToLog(), ReadMemoryModule(), and SetLoadAddress().
|
private |
Definition at line 231 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), GetProcessStopId(), IsLoaded(), LoadImageAtFileAddress(), LoadLocatedImage(), and SetProcessStopId().
|
private |
Definition at line 230 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), GetAddressByteSize(), GetArchitecture(), GetByteOrder(), KextImageInfo(), LoadLocatedImage(), and ReadMemoryModule().
|
private |
Definition at line 229 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), FindKernel(), GetAddressByteSize(), GetArchitecture(), GetByteOrder(), GetModule(), KextImageInfo(), LoadImageAtFileAddress(), LoadLocatedImage(), PrepareSearch(), and SetModule().
|
private |
Definition at line 228 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), GetName(), KextImageInfo(), LoadLocatedImage(), operator==(), PrepareSearch(), PutToLog(), ReadMemoryModule(), and SetName().
|
private |
Definition at line 237 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), GetSize(), PutToLog(), and SetSize().
|
private |
Definition at line 235 of file DynamicLoaderDarwinKernel.h.
Referenced by Clear(), GetUUID(), KextImageInfo(), LoadLocatedImage(), operator==(), PrepareSearch(), PutToLog(), ReadMemoryModule(), and SetUUID().