[PATCH] D58238: [DebugInfo] MachineSink: Insert undef DBG_VALUEs when sinking instructions, try to forward copies

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 15:48:37 PST 2019


dblaikie added a comment.

In D58238#1406518 <https://reviews.llvm.org/D58238#1406518>, @wolfgangp wrote:

> So this basically prevents the debugger from displaying an inconsistent program state when some of the sideeffects from a line preceding its current stopping point have not been completed yet. Makes sense to me. One minor concern: If the sunk instruction does not get sunk past the next source line, we may create some unneeded location list entries, e.g.:
>
> x = y; x = x + 3; z = z ? z + 3 : b;   // all on the same line
>
> If the x + 3 is sunk past the assignment to z (but before any code attributed to the next line is executed) we generate an additional location list entry for x, where there is a small gap in the covered range for x, even though the user is not able to observe x until the next line.
>  Doesn't look like a big deal, though.


Still nice/potentially worthwhile to have the location accuracy on a per-instruction basis. You could imagine if + was an operator overload and you broke inside that, went up a frame and tried ot print the variable's value - you're at the '+' (or assignment, etc) exactly, within a line, so there's still value in having the location be accurate on that sub-line granularity.


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

https://reviews.llvm.org/D58238





More information about the llvm-commits mailing list