This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] gdb: Add completer for layout command.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]