From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Add completer to commands 'target {core/tfile/exec}'
Date: Thu, 28 Mar 2013 18:50:00 -0000 [thread overview]
Message-ID: <51545E43.1020703@redhat.com> (raw)
In-Reply-To: <1364462710-16702-1-git-send-email-yao@codesourcery.com>
Nice!
On 03/28/2013 09:25 AM, Yao Qi wrote:
> 2013-03-28 Yao Qi <yao@codesourcery.com>
>
> * 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
next prev parent reply other threads:[~2013-03-28 15:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 15:14 Yao Qi
2013-03-28 18:50 ` Pedro Alves [this message]
2013-03-29 16:42 ` Yao Qi
2013-04-03 13:44 ` Doug Evans
2013-04-03 15:53 ` Yao Qi
2013-04-03 17:09 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51545E43.1020703@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox