From e08bd6c5081f4957ddb60117ac94775dcd618db7 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 24 May 2020 13:32:25 +0100 Subject: Don't remove C++ aliases from completions if symbol doesn't match completion_list_add_symbol currently tries to remove C++ function aliases from the completions match list even if the symbol passed down wasn't successfully added to the completion list because it didn't match. I.e., we call cp_canonicalize_string_no_typedefs for each and every C++ function in the program, which is useful work. This patch skips that useless work. gdb/ChangeLog: 2020-05-24 Pedro Alves * symtab.c (completion_list_add_name): Return boolean indication of whether the symbol matched. (completion_list_add_symbol): Don't try to remove C++ aliases if the symbol didn't match in the first place. * symtab.h (completion_list_add_name): Return bool. --- gdb/symtab.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/symtab.h') diff --git a/gdb/symtab.h b/gdb/symtab.h index 05e6a31..9972e81 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2332,8 +2332,9 @@ const char * /* Test to see if the symbol of language SYMBOL_LANGUAGE specified by SYMNAME (which is already demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN characters. If so, add it to - the current completion list. */ -void completion_list_add_name (completion_tracker &tracker, + the current completion list and return true. Otherwise, return + false. */ +bool completion_list_add_name (completion_tracker &tracker, language symbol_language, const char *symname, const lookup_name_info &lookup_name, -- cgit v1.1