[PATCH] D55919: [DebugInfo] Omit location list entries with empty ranges

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 02:51:17 PST 2018


dstenb created this revision.
dstenb added reviewers: davide, aprantl, dblaikie.
dstenb added a project: debug-info.
Herald added subscribers: llvm-commits, JDevlieghere, javed.absar.

This fixes PR39710. In that case we emitted a location list looking like
this:

.Ldebug_loc0:

  .quad   .Lfunc_begin0-.Lfunc_begin0
  .quad   .Lfunc_begin0-.Lfunc_begin0
  .short  1                       # Loc expr size
  .byte   85                      # DW_OP_reg5
  .quad   .Lfunc_begin0-.Lfunc_begin0
  .quad   .Lfunc_end0-.Lfunc_begin0
  .short  1                       # Loc expr size
  .byte   85                      # super-register DW_OP_reg5
  .quad   0
  .quad   0

As seen, the first entry's beginning and ending addresses evalute to 0,
which meant that the entry inadvertently became a "end of list" entry,
resulting in the location list ending sooner than expected.

To fix this, omit all entries with empty ranges. Location list entries
with empty ranges do not have any effect, as specified by DWARF, so we
might as well drop them:

"A location list entry (but not a base address selection or end of list
 entry) whose beginning and ending addresses are equal has no effect
 because the size of the range covered by such an entry is zero."


Repository:
  rL LLVM

https://reviews.llvm.org/D55919

Files:
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/DebugInfo/ARM/PR26163.ll
  test/DebugInfo/X86/PR26148.ll
  test/DebugInfo/X86/pieces-3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55919.179033.patch
Type: text/x-patch
Size: 5972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181220/fc13ab68/attachment.bin>


More information about the llvm-commits mailing list