[llvm-dev] [DebugInfo] The meaning of dbg.value positions

Jeremy Morse via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 1 06:23:00 PST 2019


Hi llvm-dev,


I've a few patches up for review that change [0] the placement of dbg.value
intrinsics in optimised code, and Paul has pointed out that I might be
creating a new interpretation of what their location in the instruction
stream _means_. My question for the list would be whether the new
interpretation matches current expectations about how dbg.value intrinsics
should work, and if not, will this new interpretation conflict
significantly with existing code.


To illustrate the potential change I've written up an addition to the
"Source Level Debugging" page here [1] describing how I believe these
intrinsics should be interpreted. To summarise, in comparison with
dbg.declares, dbg.values:


 * Correspond to assignments in the source program,

 * Terminate any location specified by dbg.values that appeared earlier in
control flow,

 * Indicate by their position in the IR where in the instruction stream the
change in variable location should occur.


The docs patch also writes down a debuginfo objective which I don't believe
is documented elsewhere: when recording variable locations for debuginfo in
optimised code, the debugger should never be able to observe a set of
variable values that did not appear in the unoptimised program. (And that
it's better for variables to be ``optimised out'' than to present an
inauthentic state of the program).


[0] https://reviews.llvm.org/D58453

[1] https://reviews.llvm.org/D58726


--

Thanks,

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190301/1308dcd6/attachment-0001.html>


More information about the llvm-dev mailing list