[Lldb-commits] [PATCH] D69309: Support template instantiation in the expression evaluator

Jaroslav Sevcik via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 21 00:56:56 PST 2019

jarin added a comment.

In D69309#1752738 <https://reviews.llvm.org/D69309#1752738>, @friss wrote:

> Sorry that I haven't reviewed the patch, but there's something I'd like to point out before anyone invests a lot of time into plugin holes in our current template support code.
> It would be great to fix the way templates are represented, because currently the debug info doesn't allow us to answer Clang's requests correctly. There is the beginning of a discussion here: http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180507/040689.html
> Basically, today the debug info will describe an entity named "Foo<int>". The accelerator tables all reference this name. So when Clang asks us if we know "Foo" (which is what happens when instantiating), we fail to find the right instantiations. The consensus of the above discussion was that we should change the debug info to have "Foo" as the name of any instantiation, with a child DIE describing the template arguments. Just doing this in the compiler causes test failures in LLDB, so there's some work to do in LLDB to support this.

Having an entity for the template itself would be great. However, that would require compiler changes, so only the code compiled with new compilers would benefit, no? I am afraid we need a story for older toolchains, too.

In this patch, I do it in a really hacky way that does not work with accelerator tables, it only works with ManualDWARFIndex by extracting template names from instantiated templates.



More information about the lldb-commits mailing list