diff options
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-layout.c | 5 | ||||
-rw-r--r-- | gdb/tui/tui-regs.c | 11 | ||||
-rw-r--r-- | gdb/tui/tui-win.c | 28 |
3 files changed, 22 insertions, 22 deletions
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index e52f789..7ecfaec 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -353,14 +353,15 @@ tui_default_win_viewport_height (enum tui_win_type type, /* Complete possible layout names. TEXT is the complete text entered so far, WORD is the word currently being completed. */ -static VEC (char_ptr) * +static void layout_completer (struct cmd_list_element *ignore, + completion_tracker &tracker, 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); + complete_on_enum (tracker, layout_names, text, word); } /* Function to initialize gdb commands, for tui window layout diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 3f9a007..c418203 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -668,24 +668,23 @@ tui_reg_command (char *args, int from_tty) /* Complete names of register groups, and add the special "prev" and "next" names. */ -static VEC (char_ptr) * +static void tui_reggroup_completer (struct cmd_list_element *ignore, + completion_tracker &tracker, const char *text, const char *word) { - VEC (char_ptr) *result = NULL; static const char *extra[] = { "next", "prev", NULL }; size_t len = strlen (word); const char **tmp; - result = reggroup_completer (ignore, text, word); + reggroup_completer (ignore, tracker, text, word); + /* XXXX use complete_on_enum instead? */ for (tmp = extra; *tmp != NULL; ++tmp) { if (strncmp (word, *tmp, len) == 0) - VEC_safe_push (char_ptr, result, xstrdup (*tmp)); + tracker.add_completion (gdb::unique_xmalloc_ptr<char> (xstrdup (*tmp))); } - - return result; } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index f49d7d5..e0df667 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -359,12 +359,12 @@ tui_set_var_cmd (char *null_args, int from_tty, struct cmd_list_element *c) window names 'next' and 'prev' will also be considered as possible completions of the window name. */ -static VEC (char_ptr) * -window_name_completer (int include_next_prev_p, +static void +window_name_completer (completion_tracker &tracker, + int include_next_prev_p, const char *text, const char *word) { VEC (const_char_ptr) *completion_name_vec = NULL; - VEC (char_ptr) *matches_vec; int win_type; for (win_type = SRC_WIN; win_type < MAX_MAJOR_WINDOWS; win_type++) @@ -398,39 +398,39 @@ window_name_completer (int include_next_prev_p, } VEC_safe_push (const_char_ptr, completion_name_vec, NULL); - matches_vec - = complete_on_enum (VEC_address (const_char_ptr, completion_name_vec), - text, word); + complete_on_enum (tracker, + VEC_address (const_char_ptr, completion_name_vec), + text, word); VEC_free (const_char_ptr, completion_name_vec); - - return matches_vec; } /* Complete possible window names to focus on. TEXT is the complete text entered so far, WORD is the word currently being completed. */ -static VEC (char_ptr) * +static void focus_completer (struct cmd_list_element *ignore, - const char *text, const char *word) + completion_tracker &tracker, + const char *text, const char *word) { - return window_name_completer (1, text, word); + window_name_completer (tracker, 1, text, word); } /* Complete possible window names for winheight command. TEXT is the complete text entered so far, WORD is the word currently being completed. */ -static VEC (char_ptr) * +static void winheight_completer (struct cmd_list_element *ignore, + completion_tracker &tracker, const char *text, const char *word) { /* The first word is the window name. That we can complete. Subsequent words can't be completed. */ if (word != text) - return NULL; + return; - return window_name_completer (0, text, word); + window_name_completer (tracker, 0, text, word); } /* Function to initialize gdb commands, for tui window |