]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/symtab.c
Don't remove C++ aliases from completions if symbol doesn't match
authorPedro Alves <palves@redhat.com>
Sun, 24 May 2020 12:32:25 +0000 (13:32 +0100)
committerPedro Alves <palves@redhat.com>
Sun, 24 May 2020 12:32:25 +0000 (13:32 +0100)
commite08bd6c5081f4957ddb60117ac94775dcd618db7
tree816111736ca11d83497d4505c9510fc892bdbfd0
parentbb68f22c8e648032a0d1c1d17353eec599ff5e6a
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  <palves@redhat.com>

* 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/ChangeLog
gdb/symtab.c
gdb/symtab.h