From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15010 invoked by alias); 29 Jan 2008 17:55:20 -0000 Received: (qmail 15002 invoked by uid 22791); 29 Jan 2008 17:55:20 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 Jan 2008 17:55:00 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 42EE398151; Tue, 29 Jan 2008 17:54:59 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 2456E9811F; Tue, 29 Jan 2008 17:54:59 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JJufi-0001TD-6W; Tue, 29 Jan 2008 12:54:58 -0500 Date: Tue, 29 Jan 2008 18:00:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA] fix Ada SYMBOL_PRINT_NAME problem Message-ID: <20080129175458.GG3773@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20080108114358.GE24614@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080108114358.GE24614@adacore.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00703.txt.bz2 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