当前位置: 首页>>代码示例>>C++>>正文


C++ ModuleSP::MatchesModuleSpec方法代码示例

本文整理汇总了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);
}
开发者ID:cemeyer,项目名称:freebsd-base-graphics,代码行数:44,代码来源:DynamicLoaderPOSIXDYLD.cpp


注:本文中的lldb::ModuleSP::MatchesModuleSpec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。