Skip to content

Commit a29b29c

Browse files
authored
[llvm-dwp] Fix FoundCUUnit problem on soft-stop with DWARF5 (llvm#169783)
Currently, when a 'soft-stop' is triggered due to debug_info overflow, there is an additional check for Dwarf5 to verify if the dwo contains a split_compile unit (CU). However, since split_type units (TUs) are typically placed before CUs in debug_info for Dwarf5, if an overflow is detected within a TU causing an early break, the logic incorrectly assumes this DWO lacks a CU and triggers an error. Since the overflowing DWO will be discarded anyway, this validation is redundant. This patch tries to fix this by removing the CU check during a soft-stop. Before this patch: ``` llvm-dwp main.dwo -continue-on-cu-index-overflow=soft-stop -o main.dwp warning: debug_info Section Contribution Offset overflow 4G. Previous Offset 4294967271, After overflow offset 38. error: no compile unit found in file: main.dwo ``` After: ```bash llvm-dwp main.dwo -continue-on-cu-index-overflow=soft-stop -o main.dwp warning: debug_info Section Contribution Offset overflow 4G. Previous Offset 4294967271, After overflow offset 38. ```
1 parent dc0fa08 commit a29b29c

File tree

2 files changed

+458
-3
lines changed

2 files changed

+458
-3
lines changed

llvm/lib/DWP/DWP.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,7 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs,
826826
"debug_info", OverflowOptValue, AnySectionOverflow))
827827
return Err;
828828
if (AnySectionOverflow) {
829-
if (Header.Version < 5 ||
830-
Header.UnitType == dwarf::DW_UT_split_compile)
831-
FoundCUUnit = true;
829+
FoundCUUnit = true;
832830
break;
833831
}
834832
}

0 commit comments

Comments
 (0)