summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-04-02 19:39:45 +0000
committerZachary Turner <zturner@google.com>2019-04-02 19:39:45 +0000
commita31347f17d1f03d01845e7d433d24dedd3dec8e0 (patch)
tree8ba7237daa2368a84568da11a8358a4a39d38dbb
parent6cd81263600d52786b2d2b49e21c8115bfd87039 (diff)
downloadbcm5719-llvm-a31347f17d1f03d01845e7d433d24dedd3dec8e0.tar.gz
bcm5719-llvm-a31347f17d1f03d01845e7d433d24dedd3dec8e0.zip
[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. llvm-svn: 357513
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp
index c8e530353fe..1838204e4ca 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp
@@ -124,11 +124,20 @@ CompilandIndexItem &CompileUnitIndex::GetOrCreateCompiland(uint16_t modi) {
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));
OpenPOWER on IntegriCloud