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 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
optional Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
array-view-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
child-path-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
cli-utils-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
common-utils-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
copy_bitwise-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
environ-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
filtered_iterator-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
format_pieces-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
function-view-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
help-doc-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
lookup_name_info-selftests.c Fix Ada crash with .debug_names 2020-04-23 07:19:43 -06:00
main-thread-selftests.c Move event-loop.[ch] to gdbsupport/ 2020-04-13 14:10:04 -06:00
memory-map-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
memrange-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
mkdir-recursive-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
observable-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
offset-type-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
optional-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
parse-connection-spec-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
ptid-selftests.c Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
rsp-low-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
scoped_fd-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
scoped_mmap-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
scoped_restore-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
string_view-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
style-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
tracepoint-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
tui-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
unpack-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
utils-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
vec-utils-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00
xml-utils-selftests.c gdb: add back declarations for _initialize functions 2020-01-13 14:01:38 -05:00