clayborg added a comment.

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.

> 
> 
>> We might think about adding a feature where if there is a mangled name and 
>> no simple name, chop up the demangled name like we do in the ObjectFile 
>> plug-ins when we see mangled names so we extract the basename out and then 
>> could use this as the simple name. This might help expressions find things 
>> correctly by basename
> 
> My worry about that is two-fold:
> 
> - it adds a demangling step (a pretty expensive operation) to something that 
> is already the biggest bottleneck in loading DWARF
> - this isn't something that we would do when using accelerator tables, so 
> this will result in inconsistent behavior in these two cases To understand 
> the tradeoffs here, it would be good to understand under what circumstances 
> can this situation occur...

Fine not doing this yet.

I will post a new diff with a simpler solution that maintains performance to 
address Adrian's question of using StringRef.


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

https://reviews.llvm.org/D62756



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to