[PATCH] D87019: [DebugInfo] Fix emitting DWARF64 .debug_rnglists sections (13/19).

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 22:25:34 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf9b242fe24f7: [DebugInfo] Fix emitting DWARF64 .debug_rnglists sections (13/19). (authored by ikudrin).

Changed prior to commit:
  https://reviews.llvm.org/D87019?vs=289872&id=291792#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87019

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/test/DebugInfo/X86/split-dwarf-v5-ranges.ll


Index: llvm/test/DebugInfo/X86/split-dwarf-v5-ranges.ll
===================================================================
--- llvm/test/DebugInfo/X86/split-dwarf-v5-ranges.ll
+++ llvm/test/DebugInfo/X86/split-dwarf-v5-ranges.ll
@@ -1,22 +1,29 @@
-; RUN: llc -split-dwarf-file=foo.dwo -mtriple=x86_64-unknown-linux-gnu -filetype=obj < %s \
-; RUN: 	    | llvm-dwarfdump -v -debug-info -debug-rnglists - | FileCheck %s
+; RUN: llc -split-dwarf-file=foo.dwo -mtriple=x86_64-unknown-linux-gnu -filetype=obj %s -o %t32
+; RUN: llvm-dwarfdump -v -debug-info -debug-rnglists %t32 | \
+; RUN:   FileCheck %s --check-prefixes=CHECK,DWARF32
 
-; CHECK: .debug_info contents:
-; CHECK: .debug_info.dwo contents:
-; CHECK: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
-; CHECK:          [0x0000000000000001, 0x000000000000000c) ".text"
-; CHECK:          [0x000000000000000e, 0x0000000000000013) ".text")
+; RUN: llc -dwarf64 -split-dwarf-file=foo.dwo -mtriple=x86_64-unknown-linux-gnu -filetype=obj %s -o %t64
+; RUN: llvm-dwarfdump -v -debug-info -debug-rnglists %t64 | \
+; RUN:   FileCheck %s --check-prefixes=CHECK,DWARF64
 
-; CHECK: .debug_rnglists.dwo contents:
-; CHECK: 0x00000000: range list header: length = 0x00000015, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
-; CHECK: offsets: [
-; CHECK: 0x00000004 => 0x00000010
-; CHECK: ]
-; CHECK: ranges:
-; CHECK: 0x00000010: [DW_RLE_base_addressx]:  0x0000000000000000
-; CHECK: 0x00000012: [DW_RLE_offset_pair  ]:  0x0000000000000001, 0x000000000000000c => [0x0000000000000001, 0x000000000000000c)
-; CHECK: 0x00000015: [DW_RLE_offset_pair  ]:  0x000000000000000e, 0x0000000000000013 => [0x000000000000000e, 0x0000000000000013)
-; CHECK: 0x00000018: [DW_RLE_end_of_list  ]
+; CHECK:   .debug_info contents:
+; CHECK:   .debug_info.dwo contents:
+; CHECK:   DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x[[#%.8x,RNG_OFF:]]
+; CHECK:      [0x0000000000000001, 0x000000000000000c) ".text"
+; CHECK:      [0x000000000000000e, 0x0000000000000013) ".text")
+
+; CHECK:   .debug_rnglists.dwo contents:
+; DWARF32: 0x00000000: range list header: length = 0x00000015, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
+; DWARF64: 0x00000000: range list header: length = 0x0000000000000019, format = DWARF64, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
+; CHECK:   offsets: [
+; DWARF32: 0x00000004 => 0x[[#RNG_OFF]]
+; DWARF64: 0x0000000000000008 => 0x[[#RNG_OFF]]
+; CHECK:   ]
+; CHECK:   ranges:
+; CHECK:   0x[[#RNG_OFF]]:   [DW_RLE_base_addressx]:  0x0000000000000000
+; CHECK:   0x[[#RNG_OFF+2]]: [DW_RLE_offset_pair  ]:  0x0000000000000001, 0x000000000000000c => [0x0000000000000001, 0x000000000000000c)
+; CHECK:   0x[[#RNG_OFF+5]]: [DW_RLE_offset_pair  ]:  0x000000000000000e, 0x0000000000000013 => [0x000000000000000e, 0x0000000000000013)
+; CHECK:   0x[[#RNG_OFF+8]]: [DW_RLE_end_of_list  ]
 
 ; Function Attrs: noinline optnone uwtable
 define dso_local void @_Z2f3v() !dbg !7 {
Index: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2549,7 +2549,8 @@
   Asm->OutStreamer->emitLabel(Holder.getRnglistsTableBaseSym());
 
   for (const RangeSpanList &List : Holder.getRangeLists())
-    Asm->emitLabelDifference(List.Label, Holder.getRnglistsTableBaseSym(), 4);
+    Asm->emitLabelDifference(List.Label, Holder.getRnglistsTableBaseSym(),
+                             Asm->getDwarfOffsetByteSize());
 
   return TableEnd;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87019.291792.patch
Type: text/x-patch
Size: 3730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200915/301f54e3/attachment.bin>


More information about the llvm-commits mailing list