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

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 08:19:46 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:

This was the only instance where something specifically like this occurred. My interest in not changing output with the aggregation trumped the "make this output searchable" goal. In an earlier revision, I'd reported each 'note' as a separate issue. I'd rather flag this with a TODO, so as not to change output yet, and have a subsequent diff that makes the output more consistent, and (as you mentioned) easier to connect to the category.

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


More information about the llvm-commits mailing list