From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11661 invoked by alias); 28 Mar 2013 15:14:26 -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 11437 invoked by uid 89); 28 Mar 2013 15:14:19 -0000 X-Spam-SWARE-Status: No, score=-8.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 28 Mar 2013 15:14:16 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2SFEDC5005133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Mar 2013 11:14:13 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2SFEBnw031393; Thu, 28 Mar 2013 11:14:12 -0400 Message-ID: <51545E43.1020703@redhat.com> Date: Thu, 28 Mar 2013 18:50:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Add completer to commands 'target {core/tfile/exec}' References: <1364462710-16702-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1364462710-16702-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-03/txt/msg01063.txt.bz2 Nice! On 03/28/2013 09:25 AM, Yao Qi wrote: > 2013-03-28 Yao Qi > > * corelow.c: Include "completer.h". > (_initialize_corelow): Call add_target_with_completer with parameter > 'filename_completer'. s/parameter/argument/ > * tracepoint.c: Likewise. > * exec.c (_initialize_exec): Likewise. > * target.c (add_target): Rename to ... > (add_target_with_completer): ... it. New. Call set_cmd_completer if > parameter completer is not NULL. s/it./this./. "New." looks stale here. Did you mean "New parameter"? > (add_target): New. > * target.h: Include "command.h". > (add_target_with_completer): Declare it. > > -/* Add a possible target architecture to the list. */ > +/* Add a possible target architecture T to the list and add a new s/Add a/Add / (you've identified T, so no longer indefinite). > + command 'target T->to_shortname'. Set COMPLETER for the command > + completer if it is not NULL. */ I suggest: "If not NULL, set COMPLETER as that command's completer." > > void > -add_target (struct target_ops *t) > +add_target_with_completer (struct target_ops *t, > + completer_ftype *completer) ... > /* Adds a command ALIAS for target T and marks it deprecated. This is useful > for maintaining backwards compatibility when renaming targets. */ > > diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp > index cddc548..df93733 100644 > --- a/gdb/testsuite/gdb.base/completion.exp > +++ b/gdb/testsuite/gdb.base/completion.exp > @@ -713,6 +713,13 @@ gdb_test "complete set gnutarget aut" "set gnutarget auto" > > gdb_test "complete set cp-abi aut" "set cp-abi auto" > > +# Test commands 'target FOO' completion works well. "Test that completion of 'target FOO' commands works well." > + > +foreach target_name { "core" "tfile" "exec" } { > + gdb_test "complete target ${target_name} ./gdb.base/completion" \ > + "target ${target_name} ./gdb.base/completion\\.exp.*" > +} Otherwise OK. Thanks, -- Pedro Alves