[COFF] Print the file name on errors writing the pdb file
authorMartin Storsjo <martin@martin.st>
Tue, 20 Aug 2019 18:56:48 +0000 (18:56 +0000)
committerMartin Storsjo <martin@martin.st>
Tue, 20 Aug 2019 18:56:48 +0000 (18:56 +0000)
This avoids confusing contextless error messages such as "No such file
or directory" if e.g. the pdb output file should be written to a
nonexistent directory. (This can happen with linkrepro scripts, at least
old ones.)

Differential Revision: https://reviews.llvm.org/D66466

llvm-svn: 369425

lld/COFF/PDB.cpp

index 1dc1353..25952b5 100644 (file)
@@ -1693,6 +1693,7 @@ void PDBLinker::addSections(ArrayRef<OutputSection *> outputSections,
 }
 
 void PDBLinker::commit(codeview::GUID *guid) {
+  ExitOnError exitOnErr((config->pdbPath + ": ").str());
   // Write to a file.
   exitOnErr(builder.commit(config->pdbPath, guid));
 }