From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26836 invoked by alias); 20 Dec 2011 15:19:15 -0000 Received: (qmail 26825 invoked by uid 22791); 20 Dec 2011 15:19:14 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Dec 2011 15:18:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBKFIVvR000699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Dec 2011 10:18:31 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBKFIUlC025561; Tue, 20 Dec 2011 10:18:30 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pBKFITDw003855; Tue, 20 Dec 2011 10:18:29 -0500 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFC] allow unqualified function names in linespecs References: <1323872680-12843-1-git-send-email-brobecker@adacore.com> Date: Tue, 20 Dec 2011 15:24:00 -0000 In-Reply-To: <1323872680-12843-1-git-send-email-brobecker@adacore.com> (Joel Brobecker's message of "Wed, 14 Dec 2011 09:24:40 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-12/txt/msg00668.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> But there are situation where it's either convenient or necessary to Joel> avoid the fully-qualified name, and use the "simple" name instead. Joel> For instance: Joel> (gdb) break foo What situations do you mean? A situation for the user, where it is convenient? Or some kind of "context" situation where if the name cannot be found locally, gdb searches? The latter I would like us to avoid. My view is that linespecs are different from expressions, and one way in particular that they are different is that they should mean the same thing no matter the context in which you evaluate them. Joel> We get lucky, enjoying the side-effects of a call Joel> cp_canonicalize_string_no_typedefs, which indirectly causes us to Joel> perform an Ada lookup which itself causes the matching partial Joel> psymtabs to be expanded to full symtabs. Ugh. This continues to be a real mess, I'm sorry about that. Joel> What this patch does is something that I feel should be hidden Joel> inside ada-lang. Namely, decide which matching routine to use based Joel> on the name we are using to search for matches. I think that the Joel> real question is to trying to find the proper interface for this. Ok, I see, it is based on the spelling of the linespec. I guess I am ok with that. I don't think it is the very best thing for us to have Ada be so very different from the rest of GDB in so many ways -- special debuginfo encoded in symbol names, special rules for linespecs, special rules for iterating symbol tables. I am sure it is better for Ada users, but the problem is that if we want to make changes to core things in GDB, eventually it requires you to step in and do a piece of the work. E.g., we just punted on .gdb_index support for Ada. I know it isn't super on the other side, either, with C++ setting the norm, regardless of the applicability to other languages. There are probably just as many C++ hacks around :-( [ ideas ] Joel> . Redesign a bit the interface. For instance, let the language Joel> itself iterate over all partial symbols? The default implementation Joel> would do what we already do. The Ada implementation would do Joel> something else, not sure what yet. And we could get rid of Joel> the la_symbol_name_compare method. I suppose either this or having a way for the language to compute the name-matching function. I am not so sure about an Ada-specific psymtab walker. I think I'd have to see the patch or a fuller proposal. Tom