This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Joel Brobecker <brobecker at gnat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 28 Nov 2004 21:08:03 -0500
- Subject: Re: [RFA/dwarf2] Use SYMBOL_SEARCH_NAME to set type name
- References: <20041022213911.GJ21300@gnat.com><20041101195035.GJ27334@gnat.com>
Joel Brobecker writes:
> With the patch, I think I have a better change of getting a review...
>
>
>
> On Fri, Oct 22, 2004 at 02:39:11PM -0700, Joel Brobecker wrote:
> > Right now, new_symbol() in dwarf2read.c sometimes sets the type name
> > using the SYMBOL_NATURAL_NAME. This is causing problems with Ada,
> > because contrary to C++ or Java, we chose to perform our searches using
> > the mangled name, not the demangled one.
> >
> > 2004-10-22 Joel Brobecker <brobecker@gnat.com>
> >
> > From Paul Hilfinger <hilfinger@gnat.com>
> > * dwarf2read.c (new_symbol): Use SYMBOL_SEARCH_NAME rather than
> > SYMBOL_NATURAL_NAME to set type names.
> >
> > Tested on x86-linux. No regression.
> > OK to apply?
>
> --
> Joel
> Index: dwarf2read.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/dwarf2read.c,v
> retrieving revision 1.168
> diff -u -p -r1.168 dwarf2read.c
> --- dwarf2read.c 19 Oct 2004 20:28:56 -0000 1.168
> +++ dwarf2read.c 1 Nov 2004 19:49:49 -0000
> @@ -6922,7 +6922,7 @@ new_symbol (struct die_info *die, struct
> this objfile, so we don't need to duplicate it for
> the type. */
> if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
> - TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NATURAL_NAME (sym);
> + TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
> add_symbol_to_list (typedef_sym, list_to_add);
> }
> }
Sigh, this is a hack on top af another. Unfortunately the initial
review of the symtab Ada changes wasn't helpful. I have no choice but
to let this go in for now, however, please, start thinking of a way to
get rid of those special cases in SYMBOL_blah_NAME. Making those
become part of the language vector comes to mind.
Can you come up with a test case for gdb.ada that shows the problem,
and is cured by this patch?