diff options
author | Tom Tromey <tromey@adacore.com> | 2020-04-23 07:19:43 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-23 07:19:43 -0600 |
commit | ecc6c6066b5cdd4663413e0bd6ef8deea1a8c889 (patch) | |
tree | 0f829dc788e3e9b9ac05695d53408c624722aed1 /gdb/ChangeLog | |
parent | 740480b88afd4f2b01d117525f534ddce28530f3 (diff) | |
download | gdb-ecc6c6066b5cdd4663413e0bd6ef8deea1a8c889.zip gdb-ecc6c6066b5cdd4663413e0bd6ef8deea1a8c889.tar.gz gdb-ecc6c6066b5cdd4663413e0bd6ef8deea1a8c889.tar.bz2 |
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".
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f5b4095..cbe2693 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +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 Tom Tromey <tom@tromey.com> * inferior.h (iterate_over_inferiors): Don't declare. |