Make the linespec/location completer ignore data symbols
Currently "b foo[TAB]" offers data symbols as completion candidates. This doesn't make sense, since you can't set a breakpoint on data symbols, only on code symbols. (gdb) b globa[TAB] (gdb) b global [ENTER] Function "global" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) info symbol global global in section .rodata So this patch makes linespec completion ignore data symbols. gdb/ChangeLog: 2017-11-08 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_make_symbol_completion_list): Use completion_skip_symbol. * symtab.c (symbol_is_function_or_method(minimal_symbol*)): New. (symbol_is_function_or_method(symbol*)): New. (add_symtab_completions): Add complete_symbol_mode parameter. Use completion_skip_symbol. (default_collect_symbol_completion_matches_break_on): Use completion_skip_symbol. Pass down mode. (collect_file_symbol_completion_matches): Pass down mode. * symtab.h (symbol_is_function_or_method): New declarations. (completion_skip_symbol): New template function.
This commit is contained in:
parent
56d87ef769
commit
f9d67a2239
4 changed files with 88 additions and 3 deletions
|
@ -6472,6 +6472,9 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
|||
{
|
||||
QUIT;
|
||||
|
||||
if (completion_skip_symbol (mode, msymbol))
|
||||
continue;
|
||||
|
||||
completion_list_add_name (tracker,
|
||||
MSYMBOL_LANGUAGE (msymbol),
|
||||
MSYMBOL_LINKAGE_NAME (msymbol),
|
||||
|
@ -6488,6 +6491,9 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
|||
|
||||
ALL_BLOCK_SYMBOLS (b, iter, sym)
|
||||
{
|
||||
if (completion_skip_symbol (mode, sym))
|
||||
continue;
|
||||
|
||||
completion_list_add_name (tracker,
|
||||
SYMBOL_LANGUAGE (sym),
|
||||
SYMBOL_LINKAGE_NAME (sym),
|
||||
|
@ -6504,6 +6510,9 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
|||
b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), GLOBAL_BLOCK);
|
||||
ALL_BLOCK_SYMBOLS (b, iter, sym)
|
||||
{
|
||||
if (completion_skip_symbol (mode, sym))
|
||||
continue;
|
||||
|
||||
completion_list_add_name (tracker,
|
||||
SYMBOL_LANGUAGE (sym),
|
||||
SYMBOL_LINKAGE_NAME (sym),
|
||||
|
@ -6520,6 +6529,9 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
|||
continue;
|
||||
ALL_BLOCK_SYMBOLS (b, iter, sym)
|
||||
{
|
||||
if (completion_skip_symbol (mode, sym))
|
||||
continue;
|
||||
|
||||
completion_list_add_name (tracker,
|
||||
SYMBOL_LANGUAGE (sym),
|
||||
SYMBOL_LINKAGE_NAME (sym),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue