Use symbol search name in expand_symtabs_matching_via_partial...
authorJoel Brobecker <brobecker@gnat.com>
Wed, 21 Dec 2011 07:34:09 +0000 (07:34 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 21 Dec 2011 07:34:09 +0000 (07:34 +0000)
We are iterating over all symbols in a partial symtab that would
match a given name, so we should match the partial symbols
search name against the given name rather than using the natural
name.  In C++, that does not make a difference, but it does in
Ada, because Ada searches using the symbol encoded name...

We also update the generation of the .gdb_index file to match this
change in the search. Although technically an incompatible change,
we do not increment the gdb_index version number, because Ada is
the only language where it would make a difference - except that
this feature is not supported for Ada.

gdb/ChangeLog:

        * psymtab.c (expand_symtabs_matching_via_partial): Match
        the partial symbols using their SYMBOL_SEARCH_NAME.
        * symfile.h (struct quick_symbol_functions): Udate the
        documentation of expand_symtabs_matching.
        * dwarf2read.c (write_psymbols): Use SYMBOL_SEARCH_NAME instead
        of SYMBOL_NATURAL_NAME in index entry.

gdb/ChangeLog
gdb/dwarf2read.c
gdb/psymtab.c
gdb/symfile.h

index b56e4e2a6c5ced4be0353a21211a42f75077433b..86c47a76a700c7616c3cdc47048806ace376ee27 100644 (file)
@@ -1,3 +1,12 @@
+2011-12-21  Joel Brobecker  <brobecker@adacore.com>
+
+       * psymtab.c (expand_symtabs_matching_via_partial): Match
+       the partial symbols using their SYMBOL_SEARCH_NAME.
+       * symfile.h (struct quick_symbol_functions): Udate the
+       documentation of expand_symtabs_matching.
+       * dwarf2read.c (write_psymbols): Use SYMBOL_SEARCH_NAME instead
+       of SYMBOL_NATURAL_NAME in index entry.
+
 2011-12-21  Joel Brobecker  <brobecker@adacore.com>
 
        * linespec.c (locate_first_half): Add handling of Ada operators
index c482c43a22c4ef3e97fea23a129b7833f5d52508..79050529aa33fc777abb6bbd05fc5e02da970025 100644 (file)
@@ -16890,7 +16890,7 @@ write_psymbols (struct mapped_symtab *symtab,
       if (!*slot)
        {
          *slot = lookup;
-         add_index_entry (symtab, SYMBOL_NATURAL_NAME (*psymp), cu_index);
+         add_index_entry (symtab, SYMBOL_SEARCH_NAME (*psymp), cu_index);
        }
     }
 }
index 74185ccb5402c6165f3c2a9aace0e34884003e53..861b30232d757b96533fbf7216836c73374d4ce6 100644 (file)
@@ -1305,7 +1305,7 @@ expand_symtabs_matching_via_partial
                   || (kind == TYPES_DOMAIN
                       && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))
                  && (*name_matcher) (current_language,
-                                     SYMBOL_NATURAL_NAME (*psym), data))
+                                     SYMBOL_SEARCH_NAME (*psym), data))
                {
                  PSYMTAB_TO_SYMTAB (ps);
                  keep_going = 0;
index 44f0c01180fd9fe3737b890d3ab4518b2a4663bd..91605a28e10617c95e93ef06dd5f3da3ca8ffda9 100644 (file)
@@ -263,10 +263,9 @@ struct quick_symbol_functions
      
      If even KIND matches, then NAME_MATCHER is called for each symbol
      defined in the file.  The current language, the symbol name and
-     DATA are passed to NAME_MATCHER.  The symbol "natural" name should
-     be passed to NAME_MATCHER for all languages except Ada, where
-     the encoded name is passed instead (see la_symbol_name_compare in
-     struct language_defn for more details on this).
+     DATA are passed to NAME_MATCHER.  The symbol "search" name should
+     be passed to NAME_MATCHER (see la_symbol_name_compare in struct
+     language_defn for more details on this).
 
      If NAME_MATCHER returns zero, then this symbol is skipped.