This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] minsyms.c: Fix switching to GNU v3 ABI
- From: Jim Blandy <jimb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: Daniel Jacobowitz <drow at mvista dot com>, david carlton <carlton at kealia dot com>
- Date: 10 Mar 2004 10:04:11 -0500
- Subject: Re: [RFA] minsyms.c: Fix switching to GNU v3 ABI
- References: <20040310105709.GJ25204@cygbert.vinschen.de>
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.