+2015-05-21 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * tui/tui-layout.c (layout_completer): New function.
+ (_initialize_tui_layout): Set completer on layout command.
+
2015-05-21 Andrew Burgess <andrew.burgess@embecosm.com>
* tui/tui-layout.c (tui_set_layout): Remove
pass "$test"
}
}
+
+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 "asm *next *prev *regs *split *src *\r\n$gdb_prompt layout $" {
+ pass "$test"
+ }
+ }
+ send_gdb "\003"
+ set test "quit command input after testing layout completion"
+ gdb_test_multiple "" "$test" {
+ -re "$gdb_prompt $" {
+ pass "$test"
+ }
+ }
+}
return h;
}
+/* Complete possible layout names. TEXT is the complete text entered so
+ far, WORD is the word currently being completed. */
+
+static VEC (char_ptr) *
+layout_completer (struct cmd_list_element *ignore,
+ const char *text, const char *word)
+{
+ static const char *layout_names [] =
+ { "src", "asm", "split", "regs", "next", "prev", NULL };
+
+ return complete_on_enum (layout_names, text, word);
+}
+
/* Function to initialize gdb commands, for tui window layout
manipulation. */
void
_initialize_tui_layout (void)
{
- add_com ("layout", class_tui, tui_layout_command, _("\
+ struct cmd_list_element *cmd;
+
+ cmd = add_com ("layout", class_tui, tui_layout_command, _("\
Change the layout of windows.\n\
Usage: layout prev | next | <layout_name> \n\
Layout names are:\n\
source/assembly/command (split) is displayed, \n\
the register window is displayed with \n\
the window that has current logical focus.\n"));
+ set_cmd_completer (cmd, layout_completer);
}