Re: Two observations using GDB 13 snapshot

Christian Biesinger via Gdb-patches
2023-01-05T14:50:17Z

On Thu, Jan 5, 2023 at 2:11 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Tom Tromey <tom@tromey.com>
> > Cc: Simon Marchi <simark@simark.ca>, cbiesinger@google.com,
> > tom@tromey.com, gdb-patches@sourceware.org, luis.machado@arm.com
> > Date: Wed, 04 Jan 2023 15:33:48 -0700
> >
> > >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> >
> > Eli> Looks like indeed strcasecmp is the culprit. With the patch below,
> > Eli> which replaces strcasecmp with a simple case-insensitive comparison
> > Eli> that only works with ASCII, the phase of reading symbols from gdb.exe
> > Eli> goes down to just 6 seconds, which is basically the same time as with
> > Eli> GDB 12.
> >
> > Thank you. Hopefully the other patch I have pending, which does
> > something similar, should have the same effect.
>
> Thanks, I applied that patch (modulo the testsuite parts), and I can
> confirm that it is almost as fast as the simple one I posted before:
> 7.5 sec vs 6.2 sec to read the symbols from gdb.exe.
>
> However, what does this change mean in terms of GDB's support for
> symbols with non-ASCII names? AFAIU, libiberty's TOLOWER only handles
> ASCII characters.
>
> If it's okay for GDB to compare case-insensitively only ASCII
> characters, then is the above patch mature enough to go to the gdb-13
> branch?

If https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.name is
up-to-date (?), then
"This ABI does not yet specify a mangling for identifiers containing
characters outside of _A-Za-z0-9."

On the other hand, if
https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#punycode-vs-utf-8
is to be believed, GCC/Clang/MSVC do use UTF-8 for symbol names. But I
don't think strcasecmp on Windows uses UTF-8?

Christian