Support wildmatching in .debug_names too.
authorPedro Alves <palves@redhat.com>
Fri, 8 Dec 2017 22:44:13 +0000 (22:44 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 8 Dec 2017 23:38:19 +0000 (23:38 +0000)
commit44ed8f3ed0264016a12cfde3126f9148c07eabfa
tree798320cdbb3c092c3a94badc76e28251172b025a
parentf00a2de2a7556c59bce93f7ced44afa8e1bbf7c3
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.
gdb/ChangeLog
gdb/dwarf2read.c