This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] fix Ada SYMBOL_PRINT_NAME problem
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 29 Jan 2008 12:54:58 -0500
- Subject: Re: [RFA] fix Ada SYMBOL_PRINT_NAME problem
- References: <20080108114358.GE24614@adacore.com>
On Tue, Jan 08, 2008 at 03:43:58AM -0800, Joel Brobecker wrote:
> Trying to print "i" will result in the following menu:
>
> (gdb) print i
> Multiple matches for i
> [0] cancel
> [1] pck__first(int) at pck.adb:3
> [2] pck__second(int) at pck.adb:7
> >
>
> The expected output (particularly for choices 1 and 2) is:
>
> (gdb) p i
> Multiple matches for i
> [0] cancel
> [1] pck.first.i at pck.adb:3
> [2] pck.second.i at pck.adb:7
> >
Of course, as far as I'm concerned, pck.first.i is the demangled
version of pck__first__i. You just don't have a convenient demangler
for it. This is related to a lot of the code duplication in
ada-lang.c that I was complaining about earlier.
The clever demangling lookup table was clever for C++, but less clever
for other languages; you'll see that Java already has some
special-case code, and the comments there (e.g. about the msymbol
having the wrong demangling) also apply to Ada.
I've no objection to this patch in principle, but you're doing it in
the wrong place. If you already know the symbol is an Ada symbol, why
go through all the rigamarole of putting it in the hash table?
--
Daniel Jacobowitz
CodeSourcery