[llvm] 977f915 - [llvm-pdbutil] Avoid reading EC names from non-EC modules (#223253)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 02:17:45 PDT 2026


Author: oltolm
Date: 2026-09-22T11:17:39+02:00
New Revision: 977f915470ae98b3e7ee0fcb5555b773b31785a0

URL: https://github.com/llvm/llvm-project/commit/977f915470ae98b3e7ee0fcb5555b773b31785a0
DIFF: https://github.com/llvm/llvm-project/commit/977f915470ae98b3e7ee0fcb5555b773b31785a0.diff

LOG: [llvm-pdbutil] Avoid reading EC names from non-EC modules (#223253)

The module dumper resolves the PDB and source file name indices for
every module, even when the module does not contain Edit and Continue
information. If the DBI stream has no EC names table, `dump --modules`
fails with:

Unexpected error processing modules: Stream Error: The stream is too
short
  to perform the requested operation.

Only resolve and print the EC names when the module's EC flag is set.

Added: 
    

Modified: 
    llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
index feb23ca2083d5..72b4e34d1e861 100644
--- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
@@ -503,15 +503,21 @@ Error DumpOutputStyle::dumpModules() {
                      Desc.getModuleStreamIndex(), Desc.getNumberOfFiles(),
                      Desc.hasECInfo());
 
-        auto PdbPathOrErr = Stream.getECName(Desc.getPdbFilePathNameIndex());
-        if (!PdbPathOrErr)
-          return PdbPathOrErr.takeError();
-        StringRef PdbFilePath = *PdbPathOrErr;
-
-        auto SrcPathOrErr = Stream.getECName(Desc.getSourceFileNameIndex());
-        if (!SrcPathOrErr)
-          return SrcPathOrErr.takeError();
-        StringRef SrcFilePath = *SrcPathOrErr;
+        StringRef PdbFilePath;
+        if (Desc.getPdbFilePathNameIndex()) {
+          auto PdbPathOrErr = Stream.getECName(Desc.getPdbFilePathNameIndex());
+          if (!PdbPathOrErr)
+            return PdbPathOrErr.takeError();
+          PdbFilePath = *PdbPathOrErr;
+        }
+
+        StringRef SrcFilePath;
+        if (Desc.getSourceFileNameIndex()) {
+          auto SrcPathOrErr = Stream.getECName(Desc.getSourceFileNameIndex());
+          if (!SrcPathOrErr)
+            return SrcPathOrErr.takeError();
+          SrcFilePath = *SrcPathOrErr;
+        }
 
         P.formatLine("pdb file ni: {0} `{1}`, src file ni: {2} `{3}`",
                      Desc.getPdbFilePathNameIndex(), PdbFilePath,


        


More information about the llvm-commits mailing list