binutils-gdb/gdb/unittests
Tom Tromey ecc6c6066b Fix Ada crash with .debug_names
PR ada/25837 points out a crash in the gdb testsuite when .debug_names
is used.  You can reproduce like:

    runtest --target_board=cc-with-debug-names \
        gdb.ada/big_packed_array.exp

The bug was introduced by commit e0802d599 ("Avoid copying in
lookup_name_info").  The problem is that the return type of
language_lookup_name changed, but in a way that didn't cause existing
callers to trigger a compilation error.  Previously, it returned a
"const string &", but after it returned a "const char *".  This caused
a string to be created in dw2_expand_symtabs_matching_symbol, but one
that had too short of a lifetime; so eventually the matcher cache
would wind up with invalid data.

This patch fixes the problem by updating the callers to use the new
type.

Tested on x86-64 Fedora 30.

gdb/ChangeLog
2020-04-23  Tom Tromey  <tromey@adacore.com>

	PR ada/25837:
	* dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Store a
	"const char *", not a "const std::string &".
	<name_and_matcher::operator==>: Update.
	* unittests/lookup_name_info-selftests.c: Change type of
	"result".
2020-04-23 07:19:43 -06:00
..
basic_string_view
optional
array-view-selftests.c
child-path-selftests.c
cli-utils-selftests.c
common-utils-selftests.c
copy_bitwise-selftests.c
environ-selftests.c
filtered_iterator-selftests.c
format_pieces-selftests.c
function-view-selftests.c
help-doc-selftests.c
lookup_name_info-selftests.c
main-thread-selftests.c
memory-map-selftests.c
memrange-selftests.c
mkdir-recursive-selftests.c
observable-selftests.c
offset-type-selftests.c
optional-selftests.c
parse-connection-spec-selftests.c
ptid-selftests.c
rsp-low-selftests.c
scoped_fd-selftests.c
scoped_mmap-selftests.c
scoped_restore-selftests.c
string_view-selftests.c
style-selftests.c
tracepoint-selftests.c
tui-selftests.c
unpack-selftests.c
utils-selftests.c
vec-utils-selftests.c
xml-utils-selftests.c