[llvm] fix llvm-gsymutil verification (PR #141751)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 05:31:44 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: None (peremyach)

<details>
<summary>Changes</summary>

Verification crashed here https://github.com/llvm/llvm-project/blob/main/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp#L519
The reason being that we to extract inline_info we recreate compile unit dies. Assert fails because we previously cleaned up just the DIEs but some other fields remained initialized.


---
Full diff: https://github.com/llvm/llvm-project/pull/141751.diff


1 Files Affected:

- (modified) llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp (+4) 


``````````diff
diff --git a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
index 1f70d273a9d9d..640141463c107 100644
--- a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -713,6 +713,10 @@ llvm::Error DwarfTransformer::verify(StringRef GsymPath,
                                      OutputAggregator &Out) {
   Out << "Verifying GSYM file \"" << GsymPath << "\":\n";
 
+  for (const auto &CU : DICtx.compile_units()) {
+    CU->clear();
+  }
+
   auto Gsym = GsymReader::openFile(GsymPath);
   if (!Gsym)
     return Gsym.takeError();

``````````

</details>


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


More information about the llvm-commits mailing list