mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 20:12:01 +08:00
Simplify completion_list_add_name | remove sym_text / sym_text_len
sym_text_len existed to strip parameters out of the lookup name. Now that that's handled by the lookup_name_info objects, the sym_text/sym_text_len parameters are no longer necessary. gdb/ChangeLog: 2017-11-08 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_make_symbol_completion_list): Remove text and text_len locals and don't pass them down. * symtab.c (completion_list_add_name): Remove sym_text/sym_text_len parameters and adjust. (completion_list_add_symbol, completion_list_add_msymbol) (completion_list_objc_symbol, completion_list_add_fields) (add_symtab_completions): Likewise. (default_collect_symbol_completion_matches_break_on) (collect_file_symbol_completion_matches): Remove sym_text_len local and don't pass it down. * symtab.h (completion_list_add_name): Remove sym_text/sym_text_len parameters.
This commit is contained in:
@ -6443,7 +6443,6 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||
const char *text, const char *word,
|
||||
enum type_code code)
|
||||
{
|
||||
int text_len;
|
||||
struct symbol *sym;
|
||||
struct compunit_symtab *s;
|
||||
struct minimal_symbol *msymbol;
|
||||
@ -6455,10 +6454,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||
|
||||
gdb_assert (code == TYPE_CODE_UNDEF);
|
||||
|
||||
text_len = strlen (text);
|
||||
|
||||
lookup_name_info lookup_name (std::string (text, text_len),
|
||||
name_match_type, true);
|
||||
lookup_name_info lookup_name (text, name_match_type, true);
|
||||
|
||||
/* First, look at the partial symtab symbols. */
|
||||
expand_symtabs_matching (NULL,
|
||||
@ -6479,8 +6475,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||
completion_list_add_name (tracker,
|
||||
MSYMBOL_LANGUAGE (msymbol),
|
||||
MSYMBOL_LINKAGE_NAME (msymbol),
|
||||
lookup_name,
|
||||
text, text_len, text, word);
|
||||
lookup_name, text, word);
|
||||
}
|
||||
|
||||
/* Search upwards from currently selected frame (so that we can
|
||||
@ -6496,8 +6491,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||
completion_list_add_name (tracker,
|
||||
SYMBOL_LANGUAGE (sym),
|
||||
SYMBOL_LINKAGE_NAME (sym),
|
||||
lookup_name,
|
||||
text, text_len, text, word);
|
||||
lookup_name, text, word);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6513,8 +6507,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||
completion_list_add_name (tracker,
|
||||
SYMBOL_LANGUAGE (sym),
|
||||
SYMBOL_LINKAGE_NAME (sym),
|
||||
lookup_name,
|
||||
text, text_len, text, word);
|
||||
lookup_name, text, word);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6530,8 +6523,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||
completion_list_add_name (tracker,
|
||||
SYMBOL_LANGUAGE (sym),
|
||||
SYMBOL_LINKAGE_NAME (sym),
|
||||
lookup_name,
|
||||
text, text_len, text, word);
|
||||
lookup_name, text, word);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user