[Lldb-commits] [lldb] r357513 - [NativePDB] Don't fail on import modules.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 2 12:39:46 PDT 2019


Author: zturner
Date: Tue Apr  2 12:39:45 2019
New Revision: 357513

URL: http://llvm.org/viewvc/llvm-project?rev=357513&view=rev
Log:
[NativePDB] Don't fail on import modules.

A recent patch to LLD started emitting information about import modules.
These are represented as compile units in the PDB, but with no
additional debug info.  This was confusing the native pdb reader, who
expected that the debug info stream be present.

This should fix failing tests on the Windows bots.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp?rev=357513&r1=357512&r2=357513&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp Tue Apr  2 12:39:45 2019
@@ -124,11 +124,20 @@ CompilandIndexItem &CompileUnitIndex::Ge
   uint16_t stream = descriptor.getModuleStreamIndex();
   std::unique_ptr<llvm::msf::MappedBlockStream> stream_data =
       m_index.pdb().createIndexedStream(stream);
+
+
+  std::unique_ptr<CompilandIndexItem>& cci = result.first->second;
+
+  if (!stream_data) {
+    llvm::pdb::ModuleDebugStreamRef debug_stream(descriptor, nullptr);
+    cci = llvm::make_unique<CompilandIndexItem>(PdbCompilandId{ modi }, debug_stream, std::move(descriptor));
+    return *cci;
+  }
+
   llvm::pdb::ModuleDebugStreamRef debug_stream(descriptor,
                                                std::move(stream_data));
-  cantFail(debug_stream.reload());
 
-  std::unique_ptr<CompilandIndexItem> &cci = result.first->second;
+  cantFail(debug_stream.reload());
 
   cci = llvm::make_unique<CompilandIndexItem>(
       PdbCompilandId{modi}, std::move(debug_stream), std::move(descriptor));




More information about the lldb-commits mailing list