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

Jaroslav Sevcik via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 17 01:45:22 PST 2019


jarin added a comment.

In D69309#1787409 <https://reviews.llvm.org/D69309#1787409>, @labath wrote:

> In D69309#1787297 <https://reviews.llvm.org/D69309#1787297>, @jarin wrote:
>
> > In D69309#1752738 <https://reviews.llvm.org/D69309#1752738>, @friss wrote:
> >
> > > 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.
> >
> >
> > Frederic, you say that "doing this in the compiler causes test failures in LLDB", which implies you have tried adding the template in the compiler. Do you have that compiler patch lying around so that we could have a look at what can be done on the lldb side?
> >
> > I agree that a good long term fix is to have "Foo" as an entity in DWARF, although for backwards compatibility it might be better if the "Foo" template just contained references to the instantiations rather than having them as children.
>
>
> I am afraid you're overestimating the scope of that idea. I *think* that Fred was referring to simply changing the string that gets put into the DW_AT_name field of the /instantation/ (and, by extension, the accelerator table). The debug info would still describe instantiations only.
>
> I don't believe anyone here was proposing to have DWARF actually describe templates themselves -- that might be possible, but you'd have to get pretty creative with dwarf attributes (and convince a bunch of people that this is actually a good idea).


You are right, I was indeed imagining something else. What Fred proposes makes a lot of sense to me, although the lookup of instantiations might be slow because there would be no accelerator for that (but we could build one).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69309/new/

https://reviews.llvm.org/D69309





More information about the lldb-commits mailing list