[llvm-dev] debug info "ref" parameter

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 22 13:05:57 PST 2016


I think probably the simplest answer is that dbg.declare documents that it
must point to an alloca ("This intrinsic provides information about a local
element (e.g., variable). The first argument is metadata holding the alloca
for the variable. ") - so it's probably best not to think too hard about
what it does when that criteria is not met.
http://llvm.org/docs/SourceLevelDebugging.html#llvm-dbg-declare

Adrian: Another thing to check for in the debug info verifier?

Carlo: You may want/need to use a llvm.dbg.value instead.

- Dave

On Thu, Dec 22, 2016 at 10:33 AM Carlo Kok <ck at remobjects.com> wrote:

>
>
> On 2016-12-22 19:02, David Blaikie wrote:
> > if you could simplify it down a bit, that might be helpful - not sure
> > there's a lot to be gained - I imagine it is just a quirk of how we
> > handle these things in the backend to make normal debug info work, but
> > there might be some things to be done to help.
> >
>
> That's my guess too, special behavior when it sees an alloca.
> Here's a simplified version, works on i386 windows and linux (most
> likely 64bits too but i don't have that handy to test)
>
> in gdb a break Test1; break Test2; run; step; locals (fine for Test1);
> run; step; (broken for Test2)
> https://gist.github.com/carlokok/202961f81bbcf1a28139eae1d6fbf1ca
>
> --
> Carlo Kok
> RemObjects Software
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161222/66485b57/attachment.html>


More information about the llvm-dev mailing list