This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] gdb: Add completer for layout command.
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org, Keith Seitz <keiths at redhat dot com>
- Date: Tue, 19 May 2015 14:38:21 +0100
- Subject: Re: [PATCH 2/2] gdb: Add completer for layout command.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1428011044 dot git dot andrew dot burgess at embecosm dot com> <18d55b2f3d6b65fd7e1fef8374fbadf429e95095 dot 1428011044 dot git dot andrew dot burgess at embecosm dot com>
Hi Andrew,
Sorry for the delay.
( Adding Keith, who's recently posted a series that touches
all completers. You guys sort it out in what order the
patches should go in. :-) )
On 04/07/2015 09:08 AM, Andrew Burgess wrote:
> Add layout name completion for the layout command. Some extra effort is
> required as some layout names use '$' which is by default a word
> breaking character.
>
> }
> +
> +gdb_test_no_output "set max-completions unlimited"
> +
> +if {![skip_tui_tests]} {
> + set test "test completion of layout names"
> + send_gdb "layout\t\t\t"
> + gdb_test_multiple "" "$test" {
> + -re "\\\$fregs \\\$gregs \\\$regs \\\$sregs asm next prev regs split src *\r\n$gdb_prompt layout $" {
> + pass "$test"
> + }
> + }
> + send_gdb "\003"
> + gdb_test_multiple "" "$test" {
> + -re "$gdb_prompt $" {
> + pass "quit command input after testing layout completion"
> + }
> + }
I think this should be:
set test "quit command input after testing layout completion"
gdb_test_multiple "" "$test" {
-re "$gdb_prompt $" {
pass $test
}
}
so that timeout or internal error caught inside gdb_test_multiple
use that test's message, instead of the previous'.
> +
> +static void
> +layout_brkchars (struct cmd_list_element *command,
> + const char *text, const char *word)
> +{
> + /* This set of characters should be the same set returned by
> + DEFAULT_WORD_BREAK_CHARACTERS but with '$' removed. */
> + set_gdb_completion_word_break_characters_string
> + (" \t\n!@#%^&*()+=|~`}{[]\"';:?/>.<,");
How about instead doing it like f_word_break_characters does?
That is, do what the comment says, at run time.
Thanks,
Pedro Alves