[Lldb-commits] [PATCH] D118812: [lldb] Add a setting to skip long mangled names

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 2 14:07:07 PST 2022


clayborg added a comment.

In D118812#3291950 <https://reviews.llvm.org/D118812#3291950>, @JDevlieghere wrote:

> In D118812#3291937 <https://reviews.llvm.org/D118812#3291937>, @clayborg wrote:
>
>> Can we put a limit on the length of the kinds of names we are willing to demangle in the first place? How long are some of these names _prior_ to demangling? It would be great if we could skip demangling names that are too long to begin with. That would allow us to skip trying to create the demangled name in the first place which is part of the memory problem right? Once the mangled name has been added to the ConstString pool it is already too late and we won't save any memory.
>
> Yep, that's exactly what this patch does: it checks the length of the mangled name and skips demangling if they are too long. It only does this while building the index though, so that if we need the demangled name elsewere we'll still cache it in the string pool.

Yikes sorry, I read line Symtab.cpp:311 as if it was demangling the name first and then checking _its_ length...

The settings leads one to believe that we don't ever demangle names longer than X characters, but it really means "don't auto demangle when indexing the symbol table". Should we actually stop the names from ever being demangled in "Mangled::GetDemangledName()" to force us to never try and demangle these kinds of names ever? We would need to have the setting modify a static value in that Mangled class when the setting gets changed so that the Mangled::GetDemangledName() function wouldn't have to try and access the settings each time someone wanted to demangle something. Then we will still display the mangled name in stack traces, but we won't ever waste time trying to demangle these names. When they are that long, they are really not useful at all for me at least.


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

https://reviews.llvm.org/D118812



More information about the lldb-commits mailing list