[llvm] Aggregate errors from llvm-dwarfutil --verify (PR #79648)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 23:05:16 PST 2024


================
@@ -240,30 +285,38 @@ unsigned DWARFVerifier::verifyUnitContents(DWARFUnit &Unit,
 
   DWARFDie Die = Unit.getUnitDIE(/* ExtractUnitDIEOnly = */ false);
   if (!Die) {
-    error() << "Compilation unit without DIE.\n";
+    ErrorCategory.Report("Compilation unit missing DIE", [&]() {
+      error() << "Compilation unit without DIE.\n";
+    });
     NumUnitErrors++;
     return NumUnitErrors;
   }
 
   if (!dwarf::isUnitType(Die.getTag())) {
-    error() << "Compilation unit root DIE is not a unit DIE: "
-            << dwarf::TagString(Die.getTag()) << ".\n";
+    ErrorCategory.Report("Compilation unit root DIE is not a unit DIE", [&]() {
+      error() << "Compilation unit root DIE is not a unit DIE: "
+              << dwarf::TagString(Die.getTag()) << ".\n";
----------------
clayborg wrote:

Show offset of the DIE using `Die.getOffset()` otherwise not enough detail in the detail message or dump the Die with `Die.dump(OS)`

https://github.com/llvm/llvm-project/pull/79648


More information about the llvm-commits mailing list