Support wildmatching in .debug_names too.
dw2_debug_names_expand_symtabs_matching currently doesn't support
symbol_name_match_type::WILD, it always matches symbol names fully.
The .gdb_index code supports via dw2_expand_symtabs_matching_symbol,
which builds the mapped_index::name_components table on demand, and
then binary searches that table.
The .debug_names names index is pretty much the same as the .gdb_index
names index, i.e., a list of fully-qualified names with no
parameter/overload info. (There's no
what-is-the-language-of-symbol-name info in .debug_names either,
unfortunately.)
So this fixes .debug_names by factoring out the related .gdb_index
code out of the mapped_index class to a base class that is inherited
by both the .gdb_index (mapped_index) and .debug_names
(mapped_debug_names) map classes.
gdb/ChangeLog:
2017-12-08 Pedro Alves <palves@redhat.com>
* dwarf2read.c (struct mapped_index_base): New, partially factored
out from ...
(struct mapped_index): ... this. Inherit mapped_index_base.
(mapped_index::symbol_name_slot_invalid):
(mapped_index::symbol_name_at): Add override marker.
(mapped_index::symbol_name_count): New.
(struct mapped_debug_names): Inherit mapped_index_base.
(mapped_debug_names::symbol_name_at): New.
(mapped_debug_names::symbol_name_count): New.
(mapped_index::find_name_components_bounds): Rename to ...
(mapped_index_base::find_name_components_bounds): ... this.
(mapped_index::build_name_components): Rename to ...
(mapped_index_base::build_name_components): ... this. Adjust to
use mapped_index_base::symbol_name_count and
mapped_index_base::symbol_name_slot_invalid.
(dw2_expand_symtabs_matching_symbol): Take a mapped_index_base
instead of a mapped_index. Use
dw2_expand_symtabs_matching_symbol.