[Lldb-commits] [PATCH] D62756: Be consistent when adding names and mangled names to the index

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 12 04:16:23 PDT 2019

labath added a comment.

In D62756#1538439 <https://reviews.llvm.org/D62756#1538439>, @clayborg wrote:

> In D62756#1526996 <https://reviews.llvm.org/D62756#1526996>, @labath wrote:
> > Being consistent definitely sounds like a good idea. Since this does change behavior somewhat, I'm wondering whether it would make sense to add a test here. The thing that's not clear to me is whether this change in behavior is only theoretical, or if it can also happen in a real-world scenario. We can always hand-construct an DIE which will have a linkage name, but no "normal" name, but I don't see how would this ever happen in practice. How did you initially discover this inconsistency?
> I added asserts in the else clause if code like:
>   if (name) {
>     ...
>   } else {
>     assert(mangled_str == nullptr);
>   }
> And I got the assert. So this is a real issue.

Ok, so in that case, can you add a test for this? It may be easiest to hand-craft some DIEs with appropriate attributes. Then you could either use `lldb-test symbols` to dump the indexes, or `lldb-test symbols -find=variable --name=foo` to actually query them.



More information about the lldb-commits mailing list