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

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 18 04:29:26 PST 2020


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