Re: [RFA] minsyms.c: Fix switching to GNU v3 ABI

Jim Blandy
2004-03-10T15:04:45Z

Corinna Vinschen <vinschen@redhat.com> writes:
> Corinna
>
> * minsyms.c (install_minimal_symbols): Create demangled names
> for all msymbol entries.
>
> Index: minsyms.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/minsyms.c,v
> retrieving revision 1.41
> diff -u -p -r1.41 minsyms.c
> --- minsyms.c 9 Feb 2004 19:13:46 -0000 1.41
> +++ minsyms.c 10 Mar 2004 10:55:25 -0000
> @@ -924,6 +924,8 @@ install_minimal_symbols (struct objfile
> mixing ABIs then the user will need to "set cp-abi"
> manually. */
> const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);
> + SYMBOL_SET_NAMES (&objfile->msymbols[i], name, strlen (name),
> + objfile);
> if (name[0] == '_' && name[1] == 'Z'
> && SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)
> {

It would be nice to get the C++ guys' opinion of this, but it's my
understanding that demangling all symbols contributes a substantial
amount of time to the startup, and can consume very large amounts of
memory when debugging large C++ programs.

If you were to move the use of SYMBOL_SET_NAMES inside the if, after
the check for the "_Z" prefix but (obviously) before the use of
SYMBOL_DEMANGLED_NAME, then we'd only try to demangle
suspicious-looking names, and we'd stop after successfully demangling
at most one.