[llvm] r309332 - [llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 16:13:18 PDT 2017


Author: rnk
Date: Thu Jul 27 16:13:18 2017
New Revision: 309332

URL: http://llvm.org/viewvc/llvm-project?rev=309332&view=rev
Log:
[llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors

The banner parameter is supposed to end in a separator, like ": ".
Otherwise, we get ugly errors like:

Error while reading publics streamNative error: blah blah

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

Modified: llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp?rev=309332&r1=309331&r2=309332&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp (original)
+++ llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp Thu Jul 27 16:13:18 2017
@@ -167,7 +167,7 @@ static void printHeader(LinePrinter &P,
 Error DumpOutputStyle::dumpFileSummary() {
   printHeader(P, "Summary");
 
-  ExitOnError Err("Invalid PDB Format");
+  ExitOnError Err("Invalid PDB Format: ");
 
   AutoIndent Indent(P);
   P.formatLine("Block Size: {0}", File.getBlockSize());
@@ -222,7 +222,7 @@ Error DumpOutputStyle::dumpStreamSummary
 
 static Expected<ModuleDebugStreamRef> getModuleDebugStream(PDBFile &File,
                                                            uint32_t Index) {
-  ExitOnError Err("Unexpected error");
+  ExitOnError Err("Unexpected error: ");
 
   auto &Dbi = Err(File.getPDBDbiStream());
   const auto &Modules = Dbi.modules();
@@ -258,7 +258,7 @@ static std::string formatChecksumKind(Fi
 namespace {
 class StringsAndChecksumsPrinter {
   const DebugStringTableSubsectionRef &extractStringTable(PDBFile &File) {
-    ExitOnError Err("Unexpected error processing modules");
+    ExitOnError Err("Unexpected error processing modules: ");
     return Err(File.getStringTable()).getStringTable();
   }
 
@@ -352,7 +352,7 @@ static void iterateModules(PDBFile &File
     return;
   }
 
-  ExitOnError Err("Unexpected error processing modules");
+  ExitOnError Err("Unexpected error processing modules: ");
 
   auto &Stream = Err(File.getPDBDbiStream());
 
@@ -409,7 +409,7 @@ Error DumpOutputStyle::dumpModules() {
     return Error::success();
   }
 
-  ExitOnError Err("Unexpected error processing modules");
+  ExitOnError Err("Unexpected error processing modules: ");
 
   auto &Stream = Err(File.getPDBDbiStream());
 
@@ -438,7 +438,7 @@ Error DumpOutputStyle::dumpModules() {
 Error DumpOutputStyle::dumpModuleFiles() {
   printHeader(P, "Files");
 
-  ExitOnError Err("Unexpected error processing modules");
+  ExitOnError Err("Unexpected error processing modules: ");
 
   iterateModules(
       File, P, 11,
@@ -738,7 +738,7 @@ Error DumpOutputStyle::dumpTpiStream(uin
     return Error::success();
   }
 
-  ExitOnError Err("Unexpected error processing types");
+  ExitOnError Err("Unexpected error processing types: ");
 
   auto &Stream = Err((StreamIdx == StreamTPI) ? File.getPDBTpiStream()
                                               : File.getPDBIpiStream());
@@ -811,7 +811,7 @@ Error DumpOutputStyle::dumpModuleSyms()
     return Error::success();
   }
 
-  ExitOnError Err("Unexpected error processing symbols");
+  ExitOnError Err("Unexpected error processing symbols: ");
 
   auto &Stream = Err(File.getPDBDbiStream());
 
@@ -864,7 +864,7 @@ Error DumpOutputStyle::dumpGlobals() {
     P.formatLine("Globals stream not present");
     return Error::success();
   }
-  ExitOnError Err("Error dumping globals stream");
+  ExitOnError Err("Error dumping globals stream: ");
   auto &Globals = Err(File.getPDBGlobalsStream());
 
   const GSIHashTable &Table = Globals.getGlobalsTable();
@@ -879,7 +879,7 @@ Error DumpOutputStyle::dumpPublics() {
     P.formatLine("Publics stream not present");
     return Error::success();
   }
-  ExitOnError Err("Error dumping publics stream");
+  ExitOnError Err("Error dumping publics stream: ");
   auto &Publics = Err(File.getPDBPublicsStream());
 
   const GSIHashTable &PublicsTable = Publics.getPublicsTable();
@@ -1051,7 +1051,7 @@ static std::string formatSegMapDescripto
 
 Error DumpOutputStyle::dumpSectionContribs() {
   printHeader(P, "Section Contributions");
-  ExitOnError Err("Error dumping publics stream");
+  ExitOnError Err("Error dumping publics stream: ");
 
   AutoIndent Indent(P);
   if (!File.hasPDBDbiStream()) {
@@ -1097,7 +1097,7 @@ Error DumpOutputStyle::dumpSectionContri
 
 Error DumpOutputStyle::dumpSectionMap() {
   printHeader(P, "Section Map");
-  ExitOnError Err("Error dumping section map");
+  ExitOnError Err("Error dumping section map: ");
 
   AutoIndent Indent(P);
   if (!File.hasPDBDbiStream()) {




More information about the llvm-commits mailing list