This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] fix Ada SYMBOL_PRINT_NAME problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]