[Lldb-commits] [PATCH] D74478: [lldb] Let TypeSystemClang::GetDisplayTypeName remove anonymous and inline namespaces.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 18 10:16:08 PST 2020


Yes, I don't think you have to solve this problem to make the suggested change.  

I think a lot of folks would appreciate the effort it would take to make names in backtraces more readable.  Sometimes, particularly when you use function objects and iterators in combination, the names are insanely long and pretty much impossible to read.  There's only so much we can tell from a mangled name - as opposed to having the full decl's, but I bet we could still get a pretty good compression from the tree-demangling and some heuristics.  So my main point was that we need to address shortening names in backtraces, but keeping them too long elsewhere isn't the right direction...

Jim


> On Feb 18, 2020, at 4:29 AM, Raphael Isemann via Phabricator <reviews at reviews.llvm.org> wrote:
> 
> teemperor added a comment.
> 
> In D74478#1874746 <https://reviews.llvm.org/D74478#1874746>, @jingham wrote:
> 
>> The only hesitation I have about this is if we are still printing this noise in demangled names, then the name of the type you see for a variable will be different from what you see when a method of that type ends up in a backtrace.  That might be confusing.  OTOH, the correct solution to that problem, IMO, is to remove the noise from backtraces, not keep it in the types...
> 
> 
> I'm not entirely sure how/if we can make the backtraces nicer as we only have the function type (but not the specific function declaration with the name) and mangled/demangled name for them. Removing the `anonymous namespace` from the backtrace is doable with that, but inline namespaces and default template arguments (which are part of the radar) aren't possible unless we start doing much more work for the backtraces and figure out the actual FunctionDecls behind each function.
> 
> FWIW, the current way we express backtraces is anyway not identical to what we show in variables. Any typedefs and so on are lost in the mangled name, so stepping into `std::string` member functions brings users to a backtrace with in `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::foo`. However printing the string shows them `std::__1::string`.
> 
> 
> Repository:
>  rLLDB LLDB
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D74478/new/
> 
> https://reviews.llvm.org/D74478
> 
> 
> 



More information about the lldb-commits mailing list