diff options
4 files changed, 15 insertions, 8 deletions
diff --git a/lldb/lit/SymbolFile/NativePDB/disassembly.cpp b/lldb/lit/SymbolFile/NativePDB/disassembly.cpp index 80cd0991704..e0abf65afbd 100644 --- a/lldb/lit/SymbolFile/NativePDB/disassembly.cpp +++ b/lldb/lit/SymbolFile/NativePDB/disassembly.cpp @@ -1,8 +1,8 @@ // clang-format off // Test that we can show disassembly and source. -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb %t.obj +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- %t.obj // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \ // RUN: %p/Inputs/disassembly.lldbinit | FileCheck %s diff --git a/lldb/lit/SymbolFile/NativePDB/simple-breakpoints.cpp b/lldb/lit/SymbolFile/NativePDB/simple-breakpoints.cpp index 8fe2ea4b9a8..5318b8e0ce3 100644 --- a/lldb/lit/SymbolFile/NativePDB/simple-breakpoints.cpp +++ b/lldb/lit/SymbolFile/NativePDB/simple-breakpoints.cpp @@ -1,8 +1,8 @@ // clang-format off // Test that we can set simple breakpoints using PDB on any platform. -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb %t.obj +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- %t.obj // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \ // RUN: %p/Inputs/breakpoints.lldbinit | FileCheck %s diff --git a/lldb/lit/SymbolFile/NativePDB/source-list.cpp b/lldb/lit/SymbolFile/NativePDB/source-list.cpp index abd90cde9dd..b176d2b3db9 100644 --- a/lldb/lit/SymbolFile/NativePDB/source-list.cpp +++ b/lldb/lit/SymbolFile/NativePDB/source-list.cpp @@ -1,8 +1,8 @@ // clang-format off // Test that we can set display source of functions. -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb %t.obj +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- %t.obj // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \ // RUN: %p/Inputs/source-list.lldbinit | FileCheck %s diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index a4cf37448be..c8b8d380327 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -70,10 +70,14 @@ static std::unique_ptr<PDBFile> loadPDBFile(std::string PdbPath, std::move(Buffer), llvm::support::little); auto File = llvm::make_unique<PDBFile>(Path, std::move(Stream), Allocator); - if (auto EC = File->parseFileHeaders()) + if (auto EC = File->parseFileHeaders()) { + llvm::consumeError(std::move(EC)); return nullptr; - if (auto EC = File->parseStreamData()) + } + if (auto EC = File->parseStreamData()) { + llvm::consumeError(std::move(EC)); return nullptr; + } return File; } @@ -109,6 +113,9 @@ loadMatchingPDBFile(std::string exe_path, llvm::BumpPtrAllocator &allocator) { if (ec || magic != llvm::file_magic::pdb) return nullptr; std::unique_ptr<PDBFile> pdb = loadPDBFile(pdb_file, allocator); + if (!pdb) + return nullptr; + auto expected_info = pdb->getPDBInfoStream(); if (!expected_info) { llvm::consumeError(expected_info.takeError()); |