<div dir="ltr">I think probably the simplest answer is that dbg.declare documents that it must point to an alloca ("<font face="lucida grande, lucida sans unicode, geneva, verdana, sans-serif"><span style="font-size:14px">This intrinsic provides information about a local element (e.g., variable). The first argument is metadata holding the alloca for the variable.</span></font><span class="inbox-inbox-Apple-converted-space"><font face="lucida grande, lucida sans unicode, geneva, verdana, sans-serif"><span style="font-size:14px"> ") - so it's probably best not to think too hard about what it does when that criteria is not met. <a href="http://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-declare">http://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-declare</a></span></font><br></span><br>Adrian: Another thing to check for in the debug info verifier?<br><br>Carlo: You may want/need to use a llvm.dbg.value instead.<br><br>- Dave<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 22, 2016 at 10:33 AM Carlo Kok <<a href="mailto:ck@remobjects.com">ck@remobjects.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
<br class="gmail_msg">
On 2016-12-22 19:02, David Blaikie wrote:<br class="gmail_msg">
> if you could simplify it down a bit, that might be helpful - not sure<br class="gmail_msg">
> there's a lot to be gained - I imagine it is just a quirk of how we<br class="gmail_msg">
> handle these things in the backend to make normal debug info work, but<br class="gmail_msg">
> there might be some things to be done to help.<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
That's my guess too, special behavior when it sees an alloca.<br class="gmail_msg">
Here's a simplified version, works on i386 windows and linux (most<br class="gmail_msg">
likely 64bits too but i don't have that handy to test)<br class="gmail_msg">
<br class="gmail_msg">
in gdb a break Test1; break Test2; run; step; locals (fine for Test1);<br class="gmail_msg">
run; step; (broken for Test2)<br class="gmail_msg">
<a href="https://gist.github.com/carlokok/202961f81bbcf1a28139eae1d6fbf1ca" rel="noreferrer" class="gmail_msg" target="_blank">https://gist.github.com/carlokok/202961f81bbcf1a28139eae1d6fbf1ca</a><br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Carlo Kok<br class="gmail_msg">
RemObjects Software<br class="gmail_msg">
</blockquote></div></div>