[PATCH] D148578: [dwarfdump][dwarf] Fix parsing of tu-index

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 17:02:56 PDT 2023


ayermolo updated this revision to Diff 515142.
ayermolo added a comment.

addressed comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148578/new/

https://reviews.llvm.org/D148578

Files:
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/test/DebugInfo/X86/dwp-v5-tu-index.s


Index: llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
===================================================================
--- llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
+++ llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
@@ -2,8 +2,8 @@
 ## compliant to the DWARFv5 standard.
 
 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o - | \
-# RUN:   llvm-dwarfdump -debug-tu-index - | \
-# RUN:   FileCheck %s
+# RUN:   llvm-dwarfdump -debug-tu-index - 2>&1 | \
+# RUN:   FileCheck %s --implicit-check-not "could not find unit with signature"
 
 # CHECK:      .debug_tu_index contents:
 # CHECK-NEXT: version = 5, units = 1, slots = 2
Index: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -869,6 +869,8 @@
       Offset = Header.getNextUnitOffset();
     }
   });
+  if (Map.empty())
+    return;
   for (DWARFUnitIndex::Entry &E : Index.getMutableRows()) {
     if (!E.isValid())
       continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148578.515142.patch
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230420/912338cd/attachment.bin>


More information about the llvm-commits mailing list