<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The most obvious place where it is lacking at the moment is that it only supports DBG_VALUEs in registers. Adding support for constant values, memory locations, and fp constants would be a big win!<div class=""><br class=""></div><div class="">thanks,</div><div class="">Adrian</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 11, 2016, at 2:52 PM, Francois Pichet <<a href="mailto:pichet2000@gmail.com" class="">pichet2000@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">In retrospect I totally agree with you. I am looking at LiveDebugValue again to see if I can improve certain specific cases.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 11, 2016 at 5:14 PM, Adrian Prantl <span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On May 11, 2016, at 2:09 PM, Francois Pichet <<a href="mailto:pichet2000@gmail.com" target="_blank" class="">pichet2000@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="">Good point.</div><div class=""><br class=""></div>Currently yes a DEBUG_VALUE "x", vreg0 will be added in BB2. Now I realize this might be wrong in some (corner?) cases where vreg0 no longer refer to "x"<div class=""><br class=""></div><div class="">My fix would be to propagate the DEBUG_VALUE only if "x" is associated with only a single virtual register.</div><div class="">BTW, my goal is to generally improve DEBUG_VALUE for optimized code, not make it 100% correct.</div></div></div></blockquote><div class=""><br class=""></div></span>I hold the (perhaps somewhat extreme) position that having debug info the *may* be correct is worse than having no debug info at all, because it means that — in the end — you then cannot trust *anything* reported by the debugger. (There are some debatable corner cases, for example, in contrast to the debugger, the user may know over which path the control flow arrived at the current break point, but these are far in between.)</div><div class=""><br class=""></div><div class="">That said, I’m very open to improvements to the quality and correctness, so please don’t feel discouraged :-)</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div></font></span><div class=""><span class="HOEnZb"><font color="#888888" class="">-- adrian</font></span><span class=""><br class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 11, 2016 at 4:43 PM, Adrian Prantl <span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br class="">
> On May 11, 2016, at 1:12 PM, Francois Pichet <<a href="mailto:pichet2000@gmail.com" target="_blank" class="">pichet2000@gmail.com</a>> wrote:<br class="">
><br class="">
</span><span class="">> Hello,<br class="">
><br class="">
> Regarding the problem of debug range for optimized code.<br class="">
> Currently a DEBUG_VALUE will be inserted after the <def>vregX<br class="">
> DEBUG_VALUE are only valid until the end of the current MachineBasicBlock. That's the main problem.<br class="">
> Why not simply iterate over all uses of vregX and insert an DEBUG_VALUE in all the MachineBasicBlocks where vregX is used. (pre regalloc)<br class="">
><br class="">
> I prototyped a small pass to do that and at first it seems to improve .debug_loc range validity and enhance the debugging experience for optimized code.<br class="">
<br class="">
</span>The problem that I see with this approach is that DEBUG_VALUEs are only valid until the next DEBUG_VALUE that describes the same variable. How does your pass handle:<br class="">
<br class="">
  BB0:<br class="">
    DEBUG_VALUE “x”, vreg0<br class="">
<br class="">
  | |<br class="">
  | BB1:<br class="">
  |  DEBUG_VALUE “x”, vreg1<br class="">
  | |<br class="">
  \_____BB2:<br class="">
    |    |<br class="">
    |____/<br class="">
  BB2:<br class="">
    vreg0 // still not clobbered here.<br class="">
<br class="">
Does it insert a DEBUG_VALUE “x”, vreg0 into BB2?<br class="">
<span class=""><font color="#888888" class=""><br class="">
-- adrian<br class="">
<br class="">
</font></span></blockquote></div><br class=""></div>
</div></blockquote></span></div><br class=""></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>