From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23921 invoked by alias); 23 Dec 2011 10:39:01 -0000 Received: (qmail 23637 invoked by uid 22791); 23 Dec 2011 10:38:57 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,WEIRD_QUOTING X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Dec 2011 10:38:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2334F2BB4C4 for ; Fri, 23 Dec 2011 05:38:36 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GulqigISOwBf for ; Fri, 23 Dec 2011 05:38:36 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A57292BB4C3 for ; Fri, 23 Dec 2011 05:38:35 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B0027145615; Fri, 23 Dec 2011 02:38:23 -0800 (PST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: unqualified function names in linespecs in Ada... (try #2) Date: Fri, 23 Dec 2011 10:39:00 -0000 Message-Id: <1324636693-24034-1-git-send-email-brobecker@adacore.com> In-Reply-To: <20111221140128.GK23376@adacore.com> References: <20111221140128.GK23376@adacore.com> 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/msg00802.txt.bz2 Hello, In reply to: http://www.sourceware.org/ml/gdb-patches/2011-12/msg00724.html Just a quick reminder: The objective is to be able to insert breakpoints using the unqualified name for functions. This has always been working, and it actually still is mostly working today. But not quite: (gdb) b "+" Function ""+"" not defined. The reason why it mostly works is thanks to a side-effect of calling cp_canonicalize_string_no_typedefs. The objective of this patch is to lift the dependency on this side effect. The crux of the matter comes from the fact that Ada provides two lookup policies: The first policy is the "full match" policy, where the user enters the symbol's fully-qualified name (Eg: pck.foo for function foo in package pck); The second one is the "wild match" policy, where the user only enters the symbol's unqualified name (Eg: foo instead of pck.foo). Which policy should be used depends on the named entered by the user. I know that C++ users would probably say that the second policy would never work with C++ code, giving too many matches to be useful. But this is, probably by far, the policy that's used the most when debugging Ada. The policy selection is correctly made when searching the full symbols. But the iteration through the partial symbols, on the other hand, is still performed using one unique policy, which happens to the "full match" one. We need a way for the language to tell the users of partial symtab iterators which one should be used. A new language method that returns a match routine has thus been implemented. The newly-created la_symbol_name_compare method thus becomes OBE and is also removed. And once the fix is implemented, there is no longer a reason for our name_matcher routines to be given the language. A followup patch cleans that up too. The whole series has been tested on x86_64-linux.