- /* Maybe they typed the file with leading directories, while the
- symbol tables record only its basename. */
- const char *tail = lbasename (srcfile);
-
- if (tail > srcfile)
- s = lookup_symtab (tail);
- }
-
- /* If we have no symtab for that file, return an empty list. */
- if (s == NULL)
- return (return_val);
-
- /* Go through this symtab and check the externs and statics for
- symbols which match. */
-
- b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK);
- ALL_BLOCK_SYMBOLS (b, iter, sym)
- {
- COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
- }
-
- b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
- ALL_BLOCK_SYMBOLS (b, iter, sym)
- {
- COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
- }
-
- return (return_val);
-}
-
-/* Wrapper around make_file_symbol_completion_list_1
- to handle MAX_COMPLETIONS_REACHED_ERROR. */
-
-VEC (char_ptr) *
-make_file_symbol_completion_list (const char *text, const char *word,
- const char *srcfile)
-{
- struct cleanup *back_to, *cleanups;
-
- completion_tracker = new_completion_tracker ();
- cleanups = make_cleanup_free_completion_tracker (&completion_tracker);
- return_val = NULL;
- back_to = make_cleanup (do_free_completion_list, &return_val);
-
- TRY
- {
- make_file_symbol_completion_list_1 (text, word, srcfile);
- }
- CATCH (except, RETURN_MASK_ERROR)
- {
- if (except.error != MAX_COMPLETIONS_REACHED_ERROR)
- throw_exception (except);
- }
- END_CATCH
-
- discard_cleanups (back_to);
- do_cleanups (cleanups);
- return return_val;