diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f5b4095083b..cbe26937198 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2020-04-23 Tom Tromey + + PR ada/25837: + * dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Store a + "const char *", not a "const std::string &". + : Update. + * unittests/lookup_name_info-selftests.c: Change type of + "result". + 2020-04-23 Tom Tromey * inferior.h (iterate_over_inferiors): Don't declare. diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index c2a9103510f..e89ed743543 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3911,11 +3911,11 @@ dw2_expand_symtabs_matching_symbol struct name_and_matcher { symbol_name_matcher_ftype *matcher; - const std::string &name; + const char *name; bool operator== (const name_and_matcher &other) const { - return matcher == other.matcher && name == other.name; + return matcher == other.matcher && strcmp (name, other.name) == 0; } }; diff --git a/gdb/unittests/lookup_name_info-selftests.c b/gdb/unittests/lookup_name_info-selftests.c index 002fc697955..6a617521cb4 100644 --- a/gdb/unittests/lookup_name_info-selftests.c +++ b/gdb/unittests/lookup_name_info-selftests.c @@ -37,14 +37,14 @@ check_make_paramless (const char *file, int line, { lookup_name_info lookup_name (name, symbol_name_match_type::FULL, completion_mode, true /* ignore_parameters */); - const std::string &result = lookup_name.language_lookup_name (lang); + const char *result = lookup_name.language_lookup_name (lang); - if (result != expected) + if (strcmp (result, expected) != 0) { error (_("%s:%d: make-paramless self-test failed: (completion=%d, lang=%d) " "\"%s\" -> \"%s\", expected \"%s\""), file, line, completion_mode, lang, name, - result.c_str (), expected); + result, expected); } }