[llvm-dev] Have the debugger show an away with a dynamic size?

Adrian Prantl via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 13 12:53:53 PST 2020


Take a look at the IR clang produces for C99 variable-length arrays.

-- adrian

> On Feb 13, 2020, at 10:03 AM, Levo DeLellis via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi. I searched and the closest thing I could find was this http://lists.llvm.org/pipermail/llvm-dev/2018-February/121348.html <http://lists.llvm.org/pipermail/llvm-dev/2018-February/121348.html>
> 
> Currently a known sized array looks and debugs as expected. I use llvm.dbg.declare with DICompositeType tag: DW_TAG_array_type and the size field. In my language arrays are always passed around with a pointer and size pair. I'd like debugging to show up as nicely instead of a pointer addr with no information about the elements. How would I do this? I don't use the C API, I output llvm-ir directly. I was hoping I can call llvm.dbg.declare/addr/value to specify the pointer, name and size of the variable but I really have no idea how to pass the size to the debugger.
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200213/d0cbbd3b/attachment.html>


More information about the llvm-dev mailing list