This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add completer to commands 'target {core/tfile/exec}'
- From: Doug Evans <dje at google dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 2 Apr 2013 14:15:20 -0700
- Subject: Re: [PATCH] Add completer to commands 'target {core/tfile/exec}'
- References: <1364462710-16702-1-git-send-email-yao at codesourcery dot com> <51545E43 dot 1020703 at redhat dot com> <5155B1A9 dot 3030503 at codesourcery dot com>
On Fri, Mar 29, 2013 at 8:22 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 03/28/2013 11:14 PM, Pedro Alves wrote:
>>> (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"?
>>
>
> "New" is not needed here. Removed. Patch below is committed. Thanks
> for the review.
>
> --
> Yao (éå)
>
> gdb:
>
> 2013-03-29 Yao Qi <yao@codesourcery.com>
>
> * corelow.c: Include "completer.h".
> (_initialize_corelow): Call add_target_with_completer with
> argument 'filename_completer'.
> * tracepoint.c: Likewise.
> * exec.c (_initialize_exec): Likewise.
> * target.c (add_target): Rename to ...
> (add_target_with_completer): ... this. Call set_cmd_completer
> if parameter completer is not NULL.
> (add_target): New.
> * target.h: Include "command.h".
> (add_target_with_completer): Declare it.
>
> gdb/testsuite:
>
> 2013-03-29 Yao Qi <yao@codesourcery.com>
>
> * gdb.base/completion.exp: Test completion of commands
> "target core", "target tfile" and "target exec".
> * gdb.trace/tfile.exp: Test completion of command
> "target tfile".
> [...]
> diff --git a/gdb/testsuite/gdb.trace/tfile.exp b/gdb/testsuite/gdb.trace/tfile.exp
> index e8a778d..3b720cc 100644
> --- a/gdb/testsuite/gdb.trace/tfile.exp
> +++ b/gdb/testsuite/gdb.trace/tfile.exp
> @@ -128,3 +128,8 @@ gdb_test \
> gdb_test "interpreter-exec mi \"-trace-status\"" \
> "\\^done,supported=\"file\",trace-file=\".*basic.tf\",running=\"0\",stop-reason=\"request\",frames=\"${decimal}\",frames-created=\"${decimal}\",buffer-size=\"${decimal}\",buffer-free=\"${decimal}\",disconnected=\".*\",circular=\".*\",user-name=\"\",notes=\"\",start-time=\".*\",stop-time=\".*\"" \
> "-trace-status"
> +
> +# Test completion works well.
> +
> +gdb_test "target tfile basic\t" "Assuming tracepoint.*" \
> + "complete-command 'target tfile'"
Hi. This test is failing for me because I have another file that
begins with "basic".
Can you change this to use "tfile-basic" instead of "basic?