[PATCH] D23283: Debugging of optimized code: When locals have their address taken as part of a call use their stack slots as location expressions for debug info.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 13:07:43 PDT 2016


aprantl added a comment.

In https://reviews.llvm.org/D23283#510313, @wolfgangp wrote:

> In https://reviews.llvm.org/D23283#510083, @aprantl wrote:
>
> > Thanks!
> >
> > Why does this need to be restricted to "simple" derefs? I understand that it's easier to convince ourselves that a single DW_OP_deref is correct, but do you have a counterexample where checking whether the first opcode in the expression is a deref would not be correct?
>
>
> No, I don't have a counterexample, but this was conservatively directed at locals that have their address taken as part of a call, based on code in LowerDbgDeclare() in Local.cpp that explicitly generates a single DW_op_deref in that case. It may be possible to improve on it, but I haven't had time to look at any more complex examples yet.


My intuition is that it shouldn't matter what other operations we perform on the value stored in the stack slot after dereferencing the pointer; in particular we should ignore any DW_OP_piece at the end of the expression.


https://reviews.llvm.org/D23283





More information about the llvm-commits mailing list