This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 18/18] Remove the vector return result from the completion API.
- From: Doug Evans <dje at google dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 22 May 2015 00:25:59 +0000
- Subject: Re: [PATCH v2 18/18] Remove the vector return result from the completion API.
- Authentication-results: sourceware.org; auth=none
Keith Seitz writes:
> This patch completes the redesign of the completion and completion-
> limiting API. Since the completer's internal data is now responsible
> for tracking all completions and the result of the completion operation
> no longer uses vectors (except for the final list given to readline),
> we can remove the vectors from the API entirely.
>
> gdb/ChangeLog
>
> * command.h (completer_ftype): Change return type from
> VEC (char_ptr) * to void. Update all users of this definition.
> * completer.h (add_completion): Remove vector argument.
> All users updated.
> * symtab.c (free_completion_list): Remove.
> (do_free_completion_list): Remove.
> (return_val): Remove global.
LGTM.
One nit.
> ...
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index 43c14c5..d634261 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> ...
> @@ -5763,17 +5723,16 @@ maybe_add_partial_symtab_filename (const char
*filename, const char *fullname,
> && filename_ncmp (base_name, data->text, data->text_len) == 0)
> {
> add_filename_to_list (data->completer_data, base_name, data->text,
> - data->word, data->list);
> + data->word);
> }
> }
> }
>
> -/* Return a vector of all source files whose names begin with matching
> - TEXT. The file names are looked up in the symbol tables of this
> - program. If the answer is no matchess, then the return value is
> - NULL. */
> +/* Add all source files whose names begin with matching TEXT to CDATA.
> + The file names are looked up in the symbol tables of this program.
> + If the answer is no matchess, then the return value is NULL. */
Probably want to reword the last sentence.
>
> -VEC (char_ptr) *
> +void
> make_source_files_completion_list (struct completer_data *cdata,
> const char *text, const char *word)
> {