diff options
author | Tom Tromey <tromey@redhat.com> | 2012-06-13 15:47:16 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-06-13 15:47:16 +0000 |
commit | 49c4e619f81a66545e2332dc218d9bf31bbb51ad (patch) | |
tree | 7eb2c5e41613a35d7030005bbc19bb23414065ed /gdb/ada-lang.c | |
parent | 625e8578d7514d65901421467d2b6f0f5d87f634 (diff) | |
download | gdb-49c4e619f81a66545e2332dc218d9bf31bbb51ad.zip gdb-49c4e619f81a66545e2332dc218d9bf31bbb51ad.tar.gz gdb-49c4e619f81a66545e2332dc218d9bf31bbb51ad.tar.bz2 |
* ada-lang.c (ada_make_symbol_completion_list): Return a VEC.
* breakpoint.c (catch_syscall_completer): Return a VEC.
* cli/cli-cmds.c (complete_command): Update.
* cli/cli-decode.c (complete_on_cmdlist): Return a VEC.
(complete_on_enum): Likewise.
* command.h: Include gdb_vecs.h.
(completer_ftype): Change return type.
(complete_on_cmdlist, complete_on_enum): Likewise.
* completer.c (noop_completer, filename_completer)
(location_completer): Return a VEC.
(add_struct_fields): Remove 'nextp' argument. Change 'output'
to a VEC.
(expression_completer, complete_line_internal, complete_line)
(command_completer): Return a VEC.
(gdb_completion_word_break_characters, line_completion_function):
Update.
* completer.h: Include gdb_vecs.h.
(complete_line, noop_completer, filename_completer)
(expression_completer, location_completer, command_completer):
Update.
* f-lang.c (f_word_break_characters): Return a VEC.
* interps.c (interpreter_completer): Return a VEC.
* language.h (struct language_defn)
<la_make_symbol_completion_list>: Return a VEC.
* python/py-cmd.c (cmdpy_completer): Return a VEC.
* symtab.c (free_completion_list): Take a VEC.
(return_val_size, return_val_index): Remove.
(return_val): Now a VEC.
(completion_list_add_name): Update.
(default_make_symbol_completion_list_break_on)
(default_make_symbol_completion_list, make_symbol_completion_list)
(make_symbol_completion_list_fn, make_file_symbol_completion_list):
Return a VEC.
(add_filename_to_list): Update.
(struct add_partial_filename_data) <list_used, list_alloced>: Remove.
<list>: Now a VEC.
(maybe_add_partial_symtab_filename): Update.
(make_source_files_completion_list): Return a VEC.
* symtab.h (default_make_symbol_completion_list_break_on)
(default_make_symbol_completion_list, make_symbol_completion_list)
(make_symbol_completion_list_fn, make_file_symbol_completion_list)
(make_source_files_completion_list): Update.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index af0fdb5..6f65472 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5797,11 +5797,10 @@ ada_expand_partial_symbol_name (const char *name, void *user_data) data->wild_match, data->encoded) != NULL; } -/* Return a list of possible symbol names completing TEXT0. The list - is NULL terminated. WORD is the entire command on which completion - is made. */ +/* Return a list of possible symbol names completing TEXT0. WORD is + the entire command on which completion is made. */ -static char ** +static VEC (char_ptr) * ada_make_symbol_completion_list (char *text0, char *word) { char *text; @@ -5914,24 +5913,7 @@ ada_make_symbol_completion_list (char *text0, char *word) } } - /* Append the closing NULL entry. */ - VEC_safe_push (char_ptr, completions, NULL); - - /* Make a copy of the COMPLETIONS VEC before we free it, and then - return the copy. It's unfortunate that we have to make a copy - of an array that we're about to destroy, but there is nothing much - we can do about it. Fortunately, it's typically not a very large - array. */ - { - const size_t completions_size = - VEC_length (char_ptr, completions) * sizeof (char *); - char **result = xmalloc (completions_size); - - memcpy (result, VEC_address (char_ptr, completions), completions_size); - - VEC_free (char_ptr, completions); - return result; - } + return completions; } /* Field Access */ |