[PATCH] D57511: [DebugInfo] Stop changing labels for parameter DBG_VALUEs

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 06:52:08 PST 2019


dstenb created this revision.
dstenb added reviewers: aprantl, dblaikie, rnk, jmorse.
dstenb added a project: debug-info.
Herald added subscribers: llvm-commits, javed.absar, nhaehnle, jvesely, jholewinski.

This is a follow-up to D57510 <https://reviews.llvm.org/D57510>. This patch removes the code from
DebugHandlerBase::beginFunction() which changes the starting label for
the first non-overlapping DBG_VALUEs of parameters to the beginning of
the function. That code does not consider what defines the values, which
can result in the ranges for the debug values starting before their
defining instructions. The code also violates the DbgValueHistoryMap's
ranges, which I think can make it quite confusing when troubleshooting.

In D57510 <https://reviews.llvm.org/D57510>, PrologEpilogInserter was amended so that parameter
DBG_VALUEs are kept at the start of the entry block, even after emission of
prologue code. That was done to reduce the degradation of debug
completeness from this patch. There might be other cases where the
DBG_VALUEs are pushed further down, for which the DebugHandlerBase code
may be helpful, but as it now quite often result in incorrect locations,
even after the prologue, it seems better to remove that code, and try to
work our way up with accurate locations.

In the long run we should maybe not aim to provide accurate locations
inside the prologue. Some single location descriptions, at least those
referring to stack values, generate inaccurate values inside the
epilogue, so we maybe should not aim to achieve accuracy for location
lists. However, it seems that we now emit line number programs that can
result in GDB and LLDB stopping inside the prologue when doing line
number stepping into functions. See PR40188 for more information.

A summary of some of the changed test cases is available in PR40188#c2.


Repository:
  rL LLVM

https://reviews.llvm.org/D57511

Files:
  lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
  test/CodeGen/AMDGPU/llvm.dbg.value.ll
  test/DebugInfo/AArch64/asan-stack-vars.mir
  test/DebugInfo/ARM/partial-subreg.ll
  test/DebugInfo/COFF/fp-stack.ll
  test/DebugInfo/COFF/fpo-stack-protect.ll
  test/DebugInfo/COFF/pieces.ll
  test/DebugInfo/MIR/AArch64/clobber-sp.mir
  test/DebugInfo/NVPTX/debug-info.ll
  test/DebugInfo/X86/debug-loc-asan.mir
  test/DebugInfo/X86/debug-loc-offset.mir
  test/DebugInfo/X86/dw_op_minus_direct.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57511.184495.patch
Type: text/x-patch
Size: 9737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190131/05f47c3c/attachment.bin>


More information about the llvm-commits mailing list