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


C++ FileSpec::FileEquals方法代码示例

本文整理汇总了C++中lldb_private::FileSpec::FileEquals方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSpec::FileEquals方法的具体用法?C++ FileSpec::FileEquals怎么用?C++ FileSpec::FileEquals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lldb_private::FileSpec的用法示例。


在下文中一共展示了FileSpec::FileEquals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ResolveSymbolContext

uint32_t SymbolFilePDB::ResolveSymbolContext(
    const lldb_private::FileSpec &file_spec, uint32_t line, bool check_inlines,
    uint32_t resolve_scope, lldb_private::SymbolContextList &sc_list) {
  if (resolve_scope & lldb::eSymbolContextCompUnit) {
    // Locate all compilation units with line numbers referencing the specified
    // file.  For example, if
    // `file_spec` is <vector>, then this should return all source files and
    // header files that reference
    // <vector>, either directly or indirectly.
    auto compilands = m_session_up->findCompilandsForSourceFile(
        file_spec.GetPath(), PDB_NameSearchFlags::NS_CaseInsensitive);

    // For each one, either find get its previously parsed data, or parse it
    // afresh and add it to
    // the symbol context list.
    while (auto compiland = compilands->getNext()) {
      // If we're not checking inlines, then don't add line information for this
      // file unless the FileSpec
      // matches.
      if (!check_inlines) {
        // `getSourceFileName` returns the basename of the original source file
        // used to generate this compiland.
        // It does not return the full path.  Currently the only way to get that
        // is to do a basename lookup to
        // get the IPDBSourceFile, but this is ambiguous in the case of two
        // source files with the same name
        // contributing to the same compiland.  This is a moderately extreme
        // edge case, so we consider this ok
        // for now, although we need to find a long term solution.
        std::string source_file = compiland->getSourceFileName();
        auto pdb_file = m_session_up->findOneSourceFile(
            compiland.get(), source_file,
            PDB_NameSearchFlags::NS_CaseInsensitive);
        source_file = pdb_file->getFileName();
        FileSpec this_spec(source_file, false, FileSpec::ePathSyntaxWindows);
        if (!file_spec.FileEquals(this_spec))
          continue;
      }

      SymbolContext sc;
      auto cu = ParseCompileUnitForSymIndex(compiland->getSymIndexId());
      sc.comp_unit = cu.get();
      sc.module_sp = cu->GetModule();
      sc_list.Append(sc);

      // If we were asked to resolve line entries, add all entries to the line
      // table that match the requested
      // line (or all lines if `line` == 0)
      if (resolve_scope & lldb::eSymbolContextLineEntry)
        ParseCompileUnitLineTable(sc, line);
    }
  }
  return sc_list.GetSize();
}
开发者ID:kraj,项目名称:lldb,代码行数:54,代码来源:SymbolFilePDB.cpp


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