本文整理汇总了C++中lldb::ModuleSP::MatchesModuleSpec方法的典型用法代码示例。如果您正苦于以下问题:C++ ModuleSP::MatchesModuleSpec方法的具体用法?C++ ModuleSP::MatchesModuleSpec怎么用?C++ ModuleSP::MatchesModuleSpec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb::ModuleSP
的用法示例。
在下文中一共展示了ModuleSP::MatchesModuleSpec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: module_spec
void
DynamicLoaderPOSIXDYLD::ResolveExecutableModule (lldb::ModuleSP &module_sp)
{
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
if (m_process == nullptr)
return;
auto &target = m_process->GetTarget ();
const auto platform_sp = target.GetPlatform ();
ProcessInstanceInfo process_info;
if (!platform_sp->GetProcessInfo (m_process->GetID (), process_info))
{
if (log)
log->Printf ("DynamicLoaderPOSIXDYLD::%s - failed to get process info for pid %" PRIu64,
__FUNCTION__, m_process->GetID ());
return;
}
if (log)
log->Printf ("DynamicLoaderPOSIXDYLD::%s - got executable by pid %" PRIu64 ": %s",
__FUNCTION__, m_process->GetID (), process_info.GetExecutableFile ().GetPath ().c_str ());
ModuleSpec module_spec (process_info.GetExecutableFile (), process_info.GetArchitecture ());
if (module_sp && module_sp->MatchesModuleSpec (module_spec))
return;
const auto executable_search_paths (Target::GetDefaultExecutableSearchPaths());
auto error = platform_sp->ResolveExecutable (
module_spec, module_sp, !executable_search_paths.IsEmpty() ? &executable_search_paths : nullptr);
if (error.Fail ())
{
StreamString stream;
module_spec.Dump (stream);
if (log)
log->Printf ("DynamicLoaderPOSIXDYLD::%s - failed to resolve executable with module spec \"%s\": %s",
__FUNCTION__, stream.GetString ().c_str (), error.AsCString ());
return;
}
target.SetExecutableModule (module_sp, false);
}