[llvm] [BOLT][DWARF] Skip processing DWARF CUs with a DWO ID but no DWO name. (PR #154749)
Alexander Yermolovich via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 9 11:48:02 PDT 2025
================
@@ -0,0 +1,737 @@
+## This test checks that broken DWARF—having
+## a DWOId but missing a DWOName—is correctly detected.
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: %clang -O3 -g -gdwarf-5 -gsplit-dwarf -Wl,-q %s -o %t/main.exe
+# RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections -comp-dir-override="%t" 2>&1 | FileCheck %s
+
+# CHECK: BOLT-ERROR: broken DWARF found in CU at offset 0x47 (DWOId=0x0, missing DW_AT_dwo_name / DW_AT_GNU_dwo_name).
+# CHECK: BOLT-ERROR: broken DWARF found in CU at offset 0x70 (DWOId=0x0, missing DW_AT_dwo_name / DW_AT_GNU_dwo_name).
+# CHECK-NOT: Assertion `RangeListsWritersByCU.count(*DWOId) == 0 && "RangeLists writer for DWO unit already exists."'
----------------
ayermolo wrote:
Good question. You can have duplicate DWO ID (which is zero, or some other value) with valid DWO_name.
If you want to handle that, I would say best way would be in another PR that specifically handles that case.
So
case1) DWO_name missing
case2) DWO ID duplicates.
https://github.com/llvm/llvm-project/pull/154749
More information about the llvm-commits
mailing list