diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2015-06-21 22:54:10 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2015-06-26 10:11:28 -0400 |
commit | 2e52ae68e7cedc3a1f9908c98ee60a8602705835 (patch) | |
tree | a5cf504057eace75c9b3eea3adaa7ab0a8f6e41b /gdb/testsuite | |
parent | 6e22494e5076e4d3c0b2c2785883162f83db499e (diff) | |
download | binutils-gdb-2e52ae68e7cedc3a1f9908c98ee60a8602705835.tar.gz |
Add tab completion for TUI's "focus" command
The implementation is pretty straightforward, with the only caveat being
that the "src", "cmd", "next" and "prev" entries get delibrately added
to the completion list even when the TUI has not yet been initialized
(i.e. has never been enabled during the session), since invoking the
"focus" command with these arguments already works when the TUI has not
yet been initialized.
gdb/ChangeLog:
* tui/tui-win.c (focus_completer): New static function.
(_initialize_tui_win): Set the completion function of the
"focus" command to focus_completer.
gdb/testsuite/ChangeLog:
* gdb.base/completion.exp: Test the completion of the "focus"
command.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/completion.exp | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9645b433a38..ce792be6f85 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-26 Patrick Palka <patrick@parcs.ath.cx> + + * gdb.base/completion.exp: Test the completion of the "focus" + command. + 2015-06-26 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.arch/amd64-prologue-skip.S: New file. diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index 4c31bfc5535..1eb0fd801a0 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -878,3 +878,21 @@ if {![skip_tui_tests]} { } } } +if {![skip_tui_tests]} { + with_test_prefix "focus command" { + set test "test completion" + send_gdb "focus \t\t" + gdb_test_multiple "" "$test" { + -re "cmd *next *prev *src *\r\n$gdb_prompt focus $" { + pass "$test" + } + } + send_gdb "\003" + set test "quit command input after testing completion" + gdb_test_multiple "" "$test" { + -re "$gdb_prompt $" { + pass "$test" + } + } + } +} |