From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103117 invoked by alias); 28 Nov 2017 02:50:41 -0000 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 Received: (qmail 103108 invoked by uid 89); 28 Nov 2017 02:50:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=eclipse, requesting, remembered, bucks X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 02:50:39 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B650D6A7D8 for ; Tue, 28 Nov 2017 02:50:38 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 815E560600; Tue, 28 Nov 2017 02:50:38 +0000 (UTC) Subject: Re: [PATCH v2.1 2/3] Make "break foo" find "A::foo", A::B::foo", etc. [C++ and wild matching] To: Pedro Alves , GDB Patches References: <1511802824-643-1-git-send-email-palves@redhat.com> <1511802824-643-3-git-send-email-palves@redhat.com> From: Keith Seitz Message-ID: <43559340-27d5-75b3-7f61-4156eca2c3b7@redhat.com> Date: Tue, 28 Nov 2017 02:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00716.txt.bz2 On 11/27/2017 04:14 PM, Pedro Alves wrote: > On 11/28/2017 12:01 AM, Pedro Alves wrote: >> On 11/27/2017 05:13 PM, Pedro Alves wrote: >>> In v2: >>> >>> - Implements Keith's suggestion of making "-qualified" a flag >>> option, instead of being a replacement for "-function". This >>> means that "break -q filename.cc:function" interprets >>> "filename.cc:function" as a linespec with two components instead >>> of a (bogus) function name. Basically, this folds in these >>> changes (with some additional cleanup here and there): >>> https://sourceware.org/ml/gdb-patches/2017-11/msg00621.html >>> https://sourceware.org/ml/gdb-patches/2017-11/msg00618.html >> >> Rereading this, I realized that the "-qualified" options wasn't being saved >> by "save breakpoints". There were a couple problems. First, >> linespec.c:canonicalize_linespec was losing the symbol_name_match_type. >> While addressing this, I realized that we don't really need to add >> a new field to ls_parser to record the desired symbol_name_match_type, >> since we can just use the one in PARSER_EXPLICIT. >> The second is that I missed updating the "-qualified" handling in >> explicit_to_string_internal to take into account the fact that >> "-qualified" now appears with traditional linespecs as well. Hahaha. If I had a dime for every time I (almost?) forgot to check "save-breakpoints," I'd have a couple of bucks by now... >> Below's what I'm folding in to the patch, to address this. New >> testcase included. > > And here's the resulting patch with that folded in. > Just one little comment. > diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c > index 833bdc0..6cb1d71 100644 > --- a/gdb/mi/mi-cmd-break.c > +++ b/gdb/mi/mi-cmd-break.c > @@ -337,7 +337,8 @@ mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc) > } > else > { > - location = string_to_event_location_basic (&address, current_language); > + location = string_to_event_location_basic (&address, current_language, > + symbol_name_match_type::WILD); > if (*address) > error (_("Garbage '%s' at end of location"), address); > } At first, the use of ::WILD here seemed odd to me. MI is to be used by user interfaces like Eclipse, I wondered why Eclipse would need WILD-card access to symbol names. But then I remembered that having access to full source code "database" is not (or should not) be a requirement for using MI. So that leaves me to assume that we intend a follow-on patch to address adding a "-qualified"-like flag for MI, too. Not requesting changes. Just thinking aloud. [I would guess the same for the similar python and guile changes.] Am I in left field? That said, LGTM. Keith