[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:15 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";
+ });
NumUnitErrors++;
}
uint8_t UnitType = Unit.getUnitType();
if (!DWARFUnit::isMatchingUnitTypeAndTag(UnitType, Die.getTag())) {
- error() << "Compilation unit type (" << dwarf::UnitTypeString(UnitType)
- << ") and root DIE (" << dwarf::TagString(Die.getTag())
- << ") do not match.\n";
+ ErrorCategory.Report("Mismatched unit type", [&]() {
+ error() << "Compilation unit type (" << dwarf::UnitTypeString(UnitType)
+ << ") and root DIE (" << dwarf::TagString(Die.getTag())
+ << ") do not match.\n";
+ });
NumUnitErrors++;
}
// According to DWARF Debugging Information Format Version 5,
// 3.1.2 Skeleton Compilation Unit Entries:
// "A skeleton compilation unit has no children."
if (Die.getTag() == dwarf::DW_TAG_skeleton_unit && Die.hasChildren()) {
- error() << "Skeleton compilation unit has children.\n";
+ ErrorCategory.Report("Skeleton CU has children", [&]() {
+ error() << "Skeleton compilation unit has children.\n";
+ });
----------------
clayborg wrote:
show offset of skeleton die in detail or dump the Die with `Die.dump(OS)`
https://github.com/llvm/llvm-project/pull/79648
More information about the llvm-commits
mailing list