From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99679 invoked by alias); 14 Jul 2017 20:55:38 -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 90874 invoked by uid 89); 14 Jul 2017 20:55:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=nonsense 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; Fri, 14 Jul 2017 20:55:30 +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 3DC603DF813 for ; Fri, 14 Jul 2017 20:55:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DC603DF813 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=keiths@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3DC603DF813 Received: from valrhona.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECD7F60604; Fri, 14 Jul 2017 20:55:28 +0000 (UTC) Subject: Re: [PATCH 15/40] Rewrite/enhance explicit locations completer, parse left->right To: Pedro Alves , gdb-patches@sourceware.org References: <1496406158-12663-1-git-send-email-palves@redhat.com> <1496406158-12663-16-git-send-email-palves@redhat.com> From: Keith Seitz Message-ID: <59692FBF.3050809@redhat.com> Date: Fri, 14 Jul 2017 20:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1496406158-12663-16-git-send-email-palves@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00204.txt.bz2 On 06/02/2017 05:22 AM, Pedro Alves wrote: > So... this patch gets rid of the need for quoting. Yippie! /me really dislikes all the quoting nonsense that users have to deal with > gdb/testsuite/ChangeLog: > yyyy-mm-dd Pedro Alves > > * gdb.base/completion.exp: Adjust expected output. > * gdb.linespec/ls-errs.exp (do_test): Adjust expected output. > diff --git a/gdb/completer.c b/gdb/completer.c > index a1d3a43..0473d8c 100644 > --- a/gdb/completer.c > +++ b/gdb/completer.c > @@ -1189,6 +1452,22 @@ completion_tracker::completion_tracker () > NULL, xcalloc, xfree); > } > > +void > +completion_tracker::discard_completions () Implicit or missing comment? > @@ -1517,6 +1839,12 @@ completion_tracker::recompute_lowest_common_denominator (const char *new_match) > } > } > > +void > +completion_tracker::advance_custom_word_point_by (size_t len) Implicit or missing comment? > +{ > + m_custom_word_point += len; > +} > + > /* Build a new C string that is a copy or LCD with the whitespace of > ORIG/ORIG_LEN preserved. > > @@ -1720,14 +2055,20 @@ completion_result::reset_match_list () > static char ** > gdb_rl_attempted_completion_function_throw (const char *text, int start, int end) > { > - /* Completers must be called twice. If rl_point (i.e., END) is at > - column 0, then readline skips the the handle_brkchars phase, and > - so we create a tracker now in that case too. */ > - delete current_completion.tracker; > - current_completion.tracker = new completion_tracker (); > + /* Completers that provide a custom word point in the > + handle_brkchars phase also compute their completions then. > + Completers that leave the completion word handling to readline > + must be called twice. If rl_point (i.e., END) is at column 0, > + then readline skips the the handle_brkchars phase, and so we ^^^^^^^ "the the" > + create a tracker now in that case too. */ > + if (end == 0 || !current_completion.tracker->use_custom_word_point ()) > + { > + delete current_completion.tracker; > + current_completion.tracker = new completion_tracker (); > > - complete_line (*current_completion.tracker, text, > - rl_line_buffer, rl_point); > + complete_line (*current_completion.tracker, text, > + rl_line_buffer, rl_point); > + } > > completion_tracker &tracker = *current_completion.tracker; > > diff --git a/gdb/location.c b/gdb/location.c > index d711d7b..19d3232 100644 > --- a/gdb/location.c > +++ b/gdb/location.c > +static bool > +is_cp_operator (const char *start, const char *comma) > +{ > + if (comma != NULL > + && (comma - start) >= CP_OPERATOR_LEN) > + { > + const char *p = comma; > + > + while (p > start && isspace (p[-1])) > + p--; > + if (p - start >= CP_OPERATOR_LEN) > + { > + p-= CP_OPERATOR_LEN; ^^^ Missing a space there. > + if (strncmp (p, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0 > + && (p == start > + || !(isalnum (p[-1]) || p[-1] == '_'))) > + { > diff --git a/gdb/symtab.c b/gdb/symtab.c > index 91e8b90..7c7ff7f 100644 > --- a/gdb/symtab.c > +++ b/gdb/symtab.c > @@ -4995,6 +4995,7 @@ add_symtab_completions (struct compunit_symtab *cust, > void > default_collect_symbol_completion_matches_break_on > (completion_tracker &tracker, > + complete_symbol_mode mode, > const char *text, const char *word, > const char *break_on, enum type_code code) > { > @@ -5013,8 +5014,12 @@ default_collect_symbol_completion_matches_break_on > const char *sym_text; > /* Length of sym_text. */ > int sym_text_len; > + struct cleanup *cleanups; `cleanups' is unused. > diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp > index 6597ea7..f03bfc3 100644 > --- a/gdb/testsuite/gdb.base/completion.exp > +++ b/gdb/testsuite/gdb.base/completion.exp > @@ -790,7 +790,7 @@ gdb_test_multiple "" $test { > -re "break\.c.*break1\.c.*$gdb_prompt " { > send_gdb "1\t\n" > gdb_test_multiple "" $test { > - -re ".*Function \"$srcfile2\" not defined\..*$gdb_prompt " { > + -re "malformed linespec error: unexpected end of input\r\n$gdb_prompt " { > pass $test > } > -re "$gdb_prompt p$" { I don't understand this change, and it FAILs for me. In the log, it is still saying "Function \"break1.c\" not found". [NOTE: the completion is still "break break1.c ".] I see this will eventually PASS (when the trailing ':' is output). Perhaps this hunk is in the wrong patch? Keith