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

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 08:31:43 PST 2024


================
@@ -167,20 +167,24 @@ bool DWARFVerifier::verifyUnitHeader(const DWARFDataExtractor DebugInfoData,
   if (!ValidLength || !ValidVersion || !ValidAddrSize || !ValidAbbrevOffset ||
       !ValidType) {
     Success = false;
-    error() << format("Units[%d] - start offset: 0x%08" PRIx64 " \n", UnitIndex,
-                      OffsetStart);
-    if (!ValidLength)
-      note() << "The length for this unit is too "
-                "large for the .debug_info provided.\n";
-    if (!ValidVersion)
-      note() << "The 16 bit unit header version is not valid.\n";
-    if (!ValidType)
-      note() << "The unit type encoding is not valid.\n";
-    if (!ValidAbbrevOffset)
-      note() << "The offset into the .debug_abbrev section is "
-                "not valid.\n";
-    if (!ValidAddrSize)
-      note() << "The address size is unsupported.\n";
+    ErrorCategory.Report("Invalid Length in Unit Header", [&]() {
----------------
kevinfrei wrote:

I think, for now, I'll swap this back to individual categories to make it a bit easier to connect the category to the unique error.

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


More information about the llvm-commits mailing list