Unit test name-component bounds searching directly
This commit factors out the name-components-vector building and bounds
searching out of dw2_expand_symtabs_matching_symbol into separate
functions, and adds unit tests that:
- expose both the latent bug mentioned in the previous commit, and
also,
- for completeness exercise the 0xff character handling fixed in the
previous commit more directly.
The actual fix for the now-exposed bug is left for the following
patch.
gdb/ChangeLog:
2017-11-21 Pedro Alves <palves@redhat.com>
* dwarf2read.c (mapped_index::name_components_casing): New field.
(mapped_index) <build_name_components,
find_name_components_bounds): Declare new methods.
(mapped_index::find_name_components_bounds)
(mapped_index::build_name_components): New methods, factored out
from dw2_expand_symtabs_matching_symbol.
(check_find_bounds_finds)
(test_mapped_index_find_name_component_bounds): New.
(run_test): Rename to ...
(test_dw2_expand_symtabs_matching_symbol): ... this.
(run_test): Reimplement.