[binutils-gdb] gdb: Convert language la_get_symbol_name_matcher field to a method

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[binutils-gdb] gdb: Convert language la_get_symbol_name_matcher field to a method

Sourceware - gdb-testers mailing list
*** TEST RESULTS FOR COMMIT c9debfb97e052c32cf0308157cae529ce2059f48 ***

commit c9debfb97e052c32cf0308157cae529ce2059f48
Author:     Andrew Burgess <[hidden email]>
AuthorDate: Mon Jun 1 11:46:54 2020 +0100
Commit:     Andrew Burgess <[hidden email]>
CommitDate: Wed Jun 17 09:25:09 2020 +0100

    gdb: Convert language la_get_symbol_name_matcher field to a method
   
    This commit changes the language_data::la_get_symbol_name_matcher
    function pointer member variable into a member function of
    language_defn.
   
    There should be no user visible changes after this commit.
   
    Before this commit access to the la_get_symbol_name_matcher function
    pointer was through the get_symbol_name_matcher function, which looked
    something like this (is pseudo-code):
   
      <return-type>
      get_symbol_name_matcher (language_defn *lang, <other args>)
      {
        if (current_language == ada)
          current_language->la_get_symbol_name_matcher (<other args>);
        else
          lang->la_get_symbol_name_matcher (<other args>);
      }
   
    In this commit I moved the get_symbol_name_matcher as a non-virtual
    function in the language_defn base class, I then add a new virtual
    method that is only used from within get_symbol_name_matcher, this can
    then be overridden by specific languages as needed.  So we now have:
   
      class language_defn
      {
        <return-type> get_symbol_name_matcher (<args>)
        {
          if (current_language == ada)
            return current_language->get_symbol_name_matcher_inner (<args>);
          else
            return this->get_symbol_name_matcher_inner (<args>);
        }
   
        virtual <return-type> get_symbol_name_matcher_inner (<args>)
        {
            ....
        }
      }
   
    gdb/ChangeLog:
   
            * ada-lang.c (ada_get_symbol_name_matcher): Update header comment.
            (ada_language_data): Delete la_get_symbol_name_matcher
            initializer.
            (language_defn::get_symbol_name_matcher_inner): New member
            function.
            * c-lang.c (c_language_data): Delete la_get_symbol_name_matcher
            initializer.
            (cplus_language_data): Likewise.
            (cplus_language::get_symbol_name_matcher_inner): New member
            function.
            (asm_language_data): Delete la_get_symbol_name_matcher initializer.
            (minimal_language_data): Likewise.
            * cp-support.h (cp_get_symbol_name_matcher): Update header comment.
            * d-lang.c (d_language_data): Delete la_get_symbol_name_matcher
            initializer.
            * dictionary.c (iter_match_first_hashed): Update call to
            get_symbol_name_matcher.
            (iter_match_next_hashed): Likewise.
            (iter_match_next_linear): Likewise.
            * dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Likewise.
            * f-lang.c (f_language_data): Delete la_get_symbol_name_matcher
            initializer.
            (f_language::get_symbol_name_matcher_inner): New member function.
            * go-lang.c (go_language_data): Delete la_get_symbol_name_matcher
            initializer.
            * language.c (default_symbol_name_matcher): Update header comment,
            make static.
            (language_defn::get_symbol_name_matcher): New definition.
            (language_defn::get_symbol_name_matcher_inner): Likewise.
            (get_symbol_name_matcher): Delete.
            (unknown_language_data): Delete la_get_symbol_name_matcher
            initializer.
            (auto_language_data): Likewise.
            * language.h (language_data): Delete la_get_symbol_name_matcher
            field.
            (language_defn::get_symbol_name_matcher): New member function.
            (language_defn::get_symbol_name_matcher_inner): Likewise.
            (default_symbol_name_matcher): Delete declaration.
            * linespec.c (find_methods): Update call to
            get_symbol_name_matcher.
            * m2-lang.c (m2_language_data): Delete la_get_symbol_name_matcher
            initializer.
            * minsyms.c (lookup_minimal_symbol): Update call to
            get_symbol_name_matcher.
            (iterate_over_minimal_symbols): Likewise.
            * objc-lang.c (objc_language_data): Delete
            la_get_symbol_name_matcher initializer.
            * opencl-lang.c (opencl_language_data): Likewise.
            * p-lang.c (pascal_language_data): Likewise.
            * psymtab.c (psymbol_name_matches): Update call to
            get_symbol_name_matcher.
            * rust-lang.c (rust_language_data): Delete
            la_get_symbol_name_matcher initializer.
            * symtab.c (symbol_matches_search_name): Update call to
            get_symbol_name_matcher.
            (compare_symbol_name): Likewise.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ae93dd6ed6..0cb660fa81 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,62 @@
+2020-06-17  Andrew Burgess  <[hidden email]>
+
+ * ada-lang.c (ada_get_symbol_name_matcher): Update header comment.
+ (ada_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ (language_defn::get_symbol_name_matcher_inner): New member
+ function.
+ * c-lang.c (c_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ (cplus_language_data): Likewise.
+ (cplus_language::get_symbol_name_matcher_inner): New member
+ function.
+ (asm_language_data): Delete la_get_symbol_name_matcher initializer.
+ (minimal_language_data): Likewise.
+ * cp-support.h (cp_get_symbol_name_matcher): Update header comment.
+ * d-lang.c (d_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ * dictionary.c (iter_match_first_hashed): Update call to
+ get_symbol_name_matcher.
+ (iter_match_next_hashed): Likewise.
+ (iter_match_next_linear): Likewise.
+ * dwarf2/read.c (dw2_expand_symtabs_matching_symbol): Likewise.
+ * f-lang.c (f_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ (f_language::get_symbol_name_matcher_inner): New member function.
+ * go-lang.c (go_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ * language.c (default_symbol_name_matcher): Update header comment,
+ make static.
+ (language_defn::get_symbol_name_matcher): New definition.
+ (language_defn::get_symbol_name_matcher_inner): Likewise.
+ (get_symbol_name_matcher): Delete.
+ (unknown_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ (auto_language_data): Likewise.
+ * language.h (language_data): Delete la_get_symbol_name_matcher
+ field.
+ (language_defn::get_symbol_name_matcher): New member function.
+ (language_defn::get_symbol_name_matcher_inner): Likewise.
+ (default_symbol_name_matcher): Delete declaration.
+ * linespec.c (find_methods): Update call to
+ get_symbol_name_matcher.
+ * m2-lang.c (m2_language_data): Delete la_get_symbol_name_matcher
+ initializer.
+ * minsyms.c (lookup_minimal_symbol): Update call to
+ get_symbol_name_matcher.
+ (iterate_over_minimal_symbols): Likewise.
+ * objc-lang.c (objc_language_data): Delete
+ la_get_symbol_name_matcher initializer.
+ * opencl-lang.c (opencl_language_data): Likewise.
+ * p-lang.c (pascal_language_data): Likewise.
+ * psymtab.c (psymbol_name_matches): Update call to
+ get_symbol_name_matcher.
+ * rust-lang.c (rust_language_data): Delete
+ la_get_symbol_name_matcher initializer.
+ * symtab.c (symbol_matches_search_name): Update call to
+ get_symbol_name_matcher.
+ (compare_symbol_name): Likewise.
+
 2020-06-17  Andrew Burgess  <[hidden email]>
 
  * ada-lang.c (ada_language_data): Delete la_compute_program
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 5caa1716b7..c91597e640 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -13862,7 +13862,7 @@ literal_symbol_name_matcher (const char *symbol_search_name,
     return false;
 }
 
-/* Implement the "la_get_symbol_name_matcher" language_defn method for
+/* Implement the "get_symbol_name_matcher" language_defn method for
    Ada.  */
 
 static symbol_name_matcher_ftype *
@@ -13920,7 +13920,6 @@ extern const struct language_data ada_language_data =
   ada_get_gdb_completer_word_break_characters,
   ada_collect_symbol_completion_matches,
   ada_watch_location_expression,
-  ada_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
   &ada_varobj_ops,
   ada_is_string_type,
   "(...)" /* la_struct_too_deep_ellipsis */
@@ -14105,6 +14104,15 @@ public:
   {
     ada_print_type (type, varstring, stream, show, level, flags);
   }
+
+protected:
+  /* See language.h.  */
+
+  symbol_name_matcher_ftype *get_symbol_name_matcher_inner
+ (const lookup_name_info &lookup_name) const override
+  {
+    return ada_get_symbol_name_matcher (lookup_name);
+  }
 };
 
 /* Single instance of the Ada language class.  */
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 9d72c0e324..8edab0779e 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -917,7 +917,6 @@ extern const struct language_data c_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &c_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
@@ -1032,7 +1031,6 @@ extern const struct language_data cplus_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  cp_get_symbol_name_matcher,
   &cplus_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
@@ -1184,6 +1182,16 @@ public:
   {
     return cp_class_name_from_physname (physname);
   }
+
+protected:
+
+  /* See language.h.  */
+
+  symbol_name_matcher_ftype *get_symbol_name_matcher_inner
+ (const lookup_name_info &lookup_name) const override
+  {
+    return cp_get_symbol_name_matcher (lookup_name);
+  }
 };
 
 /* The single instance of the C++ language class.  */
@@ -1225,7 +1233,6 @@ extern const struct language_data asm_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
@@ -1295,7 +1302,6 @@ extern const struct language_data minimal_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 7c948b212c..d031ad9a09 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -127,8 +127,7 @@ extern struct type *cp_lookup_rtti_type (const char *name,
    "function" or "bar::function" in all namespaces is possible.  */
 extern unsigned int cp_search_name_hash (const char *search_name);
 
-/* Implement the "la_get_symbol_name_matcher" language_defn method for
-   C++.  */
+/* Implement the "get_symbol_name_matcher" language_defn method for C++.  */
 extern symbol_name_matcher_ftype *cp_get_symbol_name_matcher
   (const lookup_name_info &lookup_name);
 
diff --git a/gdb/d-lang.c b/gdb/d-lang.c
index ad16f991dd..4842d4b9d6 100644
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -160,7 +160,6 @@ extern const struct language_data d_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index da44946a98..c94a49ee37 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -584,7 +584,7 @@ iter_match_first_hashed (const struct dictionary *dict,
   unsigned int hash_index = (name.search_name_hash (lang->la_language)
      % DICT_HASHED_NBUCKETS (dict));
   symbol_name_matcher_ftype *matches_name
-    = get_symbol_name_matcher (lang, name);
+    = lang->get_symbol_name_matcher (name);
   struct symbol *sym;
 
   DICT_ITERATOR_DICT (iterator) = dict;
@@ -612,7 +612,7 @@ iter_match_next_hashed (const lookup_name_info &name,
 {
   const language_defn *lang = DICT_LANGUAGE (DICT_ITERATOR_DICT (iterator));
   symbol_name_matcher_ftype *matches_name
-    = get_symbol_name_matcher (lang, name);
+    = lang->get_symbol_name_matcher (name);
   struct symbol *next;
 
   for (next = DICT_ITERATOR_CURRENT (iterator)->hash_next;
@@ -828,7 +828,7 @@ iter_match_next_linear (const lookup_name_info &name,
   const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);
   const language_defn *lang = DICT_LANGUAGE (dict);
   symbol_name_matcher_ftype *matches_name
-    = get_symbol_name_matcher (lang, name);
+    = lang->get_symbol_name_matcher (name);
 
   int i, nsyms = DICT_LINEAR_NSYMS (dict);
   struct symbol *sym, *retval = NULL;
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index d15eba9462..34915be8da 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -4097,7 +4097,7 @@ dw2_expand_symtabs_matching_symbol
 
       const language_defn *lang = language_def (lang_e);
       symbol_name_matcher_ftype *name_matcher
- = get_symbol_name_matcher (lang, lookup_name_without_params);
+ = lang->get_symbol_name_matcher (lookup_name_without_params);
 
       name_and_matcher key {
          name_matcher,
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index d748db82e4..42e6c988f3 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -620,7 +620,6 @@ extern const struct language_data f_language_data =
   f_word_break_characters,
   f_collect_symbol_completion_matches,
   c_watch_location_expression,
-  cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   f_is_string_type_p,
   "(...)" /* la_struct_too_deep_ellipsis */
@@ -699,6 +698,16 @@ public:
   {
     f_print_type (type, varstring, stream, show, level, flags);
   }
+
+protected:
+
+  /* See language.h.  */
+
+  symbol_name_matcher_ftype *get_symbol_name_matcher_inner
+ (const lookup_name_info &lookup_name) const override
+  {
+    return cp_get_symbol_name_matcher (lookup_name);
+  }
 };
 
 /* Single instance of the Fortran language class.  */
diff --git a/gdb/go-lang.c b/gdb/go-lang.c
index 9196cd3c52..661cabbe54 100644
--- a/gdb/go-lang.c
+++ b/gdb/go-lang.c
@@ -545,7 +545,6 @@ extern const struct language_data go_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   go_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/language.c b/gdb/language.c
index 2b2584f497..363481bc9d 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -622,9 +622,10 @@ language_defn::print_array_index (struct type *index_type, LONGEST index,
   fprintf_filtered (stream, "] = ");
 }
 
-/* See language.h.  */
+/* The default implementation of the get_symbol_name_matcher_inner method
+   from the language_defn class.  Matches with strncmp_iw.  */
 
-bool
+static bool
 default_symbol_name_matcher (const char *symbol_search_name,
      const lookup_name_info &lookup_name,
      completion_match_result *comp_match_res)
@@ -649,6 +650,31 @@ default_symbol_name_matcher (const char *symbol_search_name,
 
 /* See language.h.  */
 
+symbol_name_matcher_ftype *
+language_defn::get_symbol_name_matcher
+ (const lookup_name_info &lookup_name) const
+{
+  /* If currently in Ada mode, and the lookup name is wrapped in
+     '<...>', hijack all symbol name comparisons using the Ada
+     matcher, which handles the verbatim matching.  */
+  if (current_language->la_language == language_ada
+      && lookup_name.ada ().verbatim_p ())
+    return current_language->get_symbol_name_matcher_inner (lookup_name);
+
+  return this->get_symbol_name_matcher_inner (lookup_name);
+}
+
+/* See language.h.  */
+
+symbol_name_matcher_ftype *
+language_defn::get_symbol_name_matcher_inner
+ (const lookup_name_info &lookup_name) const
+{
+  return default_symbol_name_matcher;
+}
+
+/* See language.h.  */
+
 bool
 default_is_string_type_p (struct type *type)
 {
@@ -661,24 +687,6 @@ default_is_string_type_p (struct type *type)
   return (type->code ()  == TYPE_CODE_STRING);
 }
 
-/* See language.h.  */
-
-symbol_name_matcher_ftype *
-get_symbol_name_matcher (const language_defn *lang,
- const lookup_name_info &lookup_name)
-{
-  /* If currently in Ada mode, and the lookup name is wrapped in
-     '<...>', hijack all symbol name comparisons using the Ada
-     matcher, which handles the verbatim matching.  */
-  if (current_language->la_language == language_ada
-      && lookup_name.ada ().verbatim_p ())
-    return current_language->la_get_symbol_name_matcher (lookup_name);
-
-  if (lang->la_get_symbol_name_matcher != nullptr)
-    return lang->la_get_symbol_name_matcher (lookup_name);
-  return default_symbol_name_matcher;
-}
-
 /* Define the language that is no language.  */
 
 static int
@@ -774,7 +782,6 @@ extern const struct language_data unknown_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   default_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
@@ -848,7 +855,6 @@ extern const struct language_data auto_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   default_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/language.h b/gdb/language.h
index 523a7a923b..7e5837fdef 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -338,19 +338,6 @@ struct language_data
     gdb::unique_xmalloc_ptr<char> (*la_watch_location_expression)
          (struct type *type, CORE_ADDR addr);
 
-    /* Return a pointer to the function that should be used to match a
-       symbol name against LOOKUP_NAME, according to this language's
-       rules.  The matching algorithm depends on LOOKUP_NAME.  For
-       example, on Ada, the matching algorithm depends on the symbol
-       name (wild/full/verbatim matching), and on whether we're doing
-       a normal lookup or a completion match lookup.
-
-       This field may be NULL, in which case
-       default_symbol_name_matcher is used to perform the
-       matching.  */
-    symbol_name_matcher_ftype *(*la_get_symbol_name_matcher)
-      (const lookup_name_info &);
-
     /* Various operations on varobj.  */
     const struct lang_varobj_ops *la_varobj_ops;
 
@@ -443,6 +430,20 @@ struct language_defn : language_data
     return ::iterate_over_symbols (block, name, domain, callback);
   }
 
+  /* Return a pointer to the function that should be used to match a
+     symbol name against LOOKUP_NAME, according to this language's
+     rules.  The matching algorithm depends on LOOKUP_NAME.  For
+     example, on Ada, the matching algorithm depends on the symbol
+     name (wild/full/verbatim matching), and on whether we're doing
+     a normal lookup or a completion match lookup.
+
+     As Ada wants to capture symbol matching for all languages in some
+     cases, then this method is a non-overridable interface.  Languages
+     should override GET_SYMBOL_NAME_MATCHER_INNER if they need to.  */
+
+  symbol_name_matcher_ftype *get_symbol_name_matcher
+ (const lookup_name_info &lookup_name) const;
+
   /* If this language allows compilation from the gdb command line, then
      this method will return an instance of struct gcc_context appropriate
      to the language.  If compilation for this language is generally
@@ -530,6 +531,14 @@ struct language_defn : language_data
 
   /* List of all known languages.  */
   static const struct language_defn *languages[nr_languages];
+
+protected:
+
+  /* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
+     See that method for a description of the arguments.  */
+
+  virtual symbol_name_matcher_ftype *get_symbol_name_matcher_inner
+  (const lookup_name_info &lookup_name) const;
 };
 
 /* Pointer to the language_defn for our current language.  This pointer
@@ -698,13 +707,6 @@ void c_get_string (struct value *value,
    int *length, struct type **char_type,
    const char **charset);
 
-/* The default implementation of la_symbol_name_matcher.  Matches with
-   strncmp_iw.  */
-extern bool default_symbol_name_matcher
-  (const char *symbol_search_name,
-   const lookup_name_info &lookup_name,
-   completion_match_result *comp_match_res);
-
 /* Get LANG's symbol_name_matcher method for LOOKUP_NAME.  Returns
    default_symbol_name_matcher if not set.  LANG is used as a hint;
    the function may ignore it depending on the current language and
diff --git a/gdb/linespec.c b/gdb/linespec.c
index ddca05b3db..4a634e3aff 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1232,7 +1232,7 @@ find_methods (struct type *t, enum language t_lang, const char *name,
       int method_counter;
       lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
       symbol_name_matcher_ftype *symbol_name_compare
- = get_symbol_name_matcher (language_def (t_lang), lookup_name);
+ = language_def (t_lang)->get_symbol_name_matcher (lookup_name);
 
       t = check_typedef (t);
 
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 87bf1eb63d..9245ebbeea 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -379,7 +379,6 @@ extern const struct language_data m2_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   m2_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 47c6f0bc0c..f4a2544eb1 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -363,8 +363,8 @@ lookup_minimal_symbol (const char *name, const char *sfile,
        % MINIMAL_SYMBOL_HASH_SIZE);
 
   symbol_name_matcher_ftype *match
-    = get_symbol_name_matcher (language_def (lang),
-       lookup_name);
+    = language_def (lang)->get_symbol_name_matcher
+ (lookup_name);
   struct minimal_symbol **msymbol_demangled_hash
     = objfile->per_bfd->msymbol_demangled_hash;
 
@@ -507,7 +507,7 @@ iterate_over_minimal_symbols
       enum language lang = (enum language) liter;
       const language_defn *lang_def = language_def (lang);
       symbol_name_matcher_ftype *name_match
- = get_symbol_name_matcher (lang_def, lookup_name);
+ = lang_def->get_symbol_name_matcher (lookup_name);
 
       unsigned int hash
  = lookup_name.search_name_hash (lang) % MINIMAL_SYMBOL_HASH_SIZE;
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 8b23c55798..9a77f6cb96 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -354,7 +354,6 @@ extern const struct language_data objc_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index 00f88c6037..377c550d5a 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -1033,7 +1033,6 @@ extern const struct language_data opencl_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   c_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 869c89e926..189617afc0 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -410,7 +410,6 @@ extern const struct language_data pascal_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   c_watch_location_expression,
-  NULL, /* la_compare_symbol_for_completion */
   &default_varobj_ops,
   pascal_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 5960c593fc..47e31aab61 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -557,7 +557,7 @@ psymbol_name_matches (partial_symbol *psym,
 {
   const language_defn *lang = language_def (psym->ginfo.language ());
   symbol_name_matcher_ftype *name_match
-    = get_symbol_name_matcher (lang, lookup_name);
+    = lang->get_symbol_name_matcher (lookup_name);
   return name_match (psym->ginfo.search_name (), lookup_name, NULL);
 }
 
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 296bfe1dcf..3f187bdea5 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -2065,7 +2065,6 @@ extern const struct language_data rust_language_data =
   default_word_break_characters,
   default_collect_symbol_completion_matches,
   rust_watch_location_expression,
-  NULL, /* la_get_symbol_name_matcher */
   &default_varobj_ops,
   rust_is_string_type_p,
   "{...}" /* la_struct_too_deep_ellipsis */
diff --git a/gdb/symtab.c b/gdb/symtab.c
index b255cc7232..ec0d94b87d 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1016,7 +1016,7 @@ symbol_matches_search_name (const struct general_symbol_info *gsymbol,
     const lookup_name_info &name)
 {
   symbol_name_matcher_ftype *name_match
-    = get_symbol_name_matcher (language_def (gsymbol->language ()), name);
+    = language_def (gsymbol->language ())->get_symbol_name_matcher (name);
   return name_match (gsymbol->search_name (), name, NULL);
 }
 
@@ -5258,7 +5258,7 @@ compare_symbol_name (const char *symbol_name, language symbol_language,
   const language_defn *lang = language_def (symbol_language);
 
   symbol_name_matcher_ftype *name_match
-    = get_symbol_name_matcher (lang, lookup_name);
+    = lang->get_symbol_name_matcher (lookup_name);
 
   return name_match (symbol_name, lookup_name, &match_res);
 }
Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
Buildername:
        Ubuntu-Aarch64-native-extended-gdbserver-m64

Worker:
        ubuntu-aarch64

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/5/builds/3068

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.arch/aarch64-brk-patterns.exp: insert breakpoint at brk instruction 1
PASS -> FAIL: gdb.base/step-over-syscall.exp: fork: displaced=off: check_pc_after_cross_syscall: single step over fork final pc
new UNRESOLVED: gdb.opencl/callfuncs.exp: OpenCL support not detected
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Ubuntu-Aarch64-native-gdbserver-m64

Worker:
        ubuntu-aarch64

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/19/builds/3109

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-cc-with-index, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-cc-with-index

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/20/builds/3420

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i3
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m32, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-m32

Worker:
        fedora-x86-64-3

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/17/builds/3466

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
new FAIL: gdb.base/coredump-filter.exp: disassembling function main for non-Private-Anonymous: no binary: loading /home/gdb-buildbot/fedora-x86-64-3/fedora-x86-64-m32/build/gdb/testsuite/outputs/gdb.base/coredump-filter/non-private-anon.gcore
new FAIL: gdb.base/coredump-filter.exp: loading and testing corefile for non-Shared-Anonymous: loading /home/gdb-buildbot/fedora-x86-64-3/fedora-x86-64-m32/build/gdb/testsuite/outputs/gdb.base/coredump-filter/non-shared-anon.gcore
PASS -> FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: single step over clone
PASS -> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 10: break at break_fn: 1
PASS -> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 10: break at break_fn: 2
PASS -> FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 10: break at break_fn: 3
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m64, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-m64

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/3/builds/3529

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: no threads left
PASS -> FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: only inferior 1 left
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m32

Worker:
        fedora-x86-64-3

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/4/builds/3362

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.fortran/vla-ptype.exp: ptype vla1
PASS -> FAIL: gdb.fortran/vla-value.exp: print member in non-allocated vla1
PASS -> FAIL: gdb.fortran/vla-value.exp: set member in non-allocated vla1
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=1: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=1: print re_run_var_1
new UNRESOLVED: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: delete all breakpoints in delete_breakpoints
PASS -> UNRESOLVED: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: setting breakpoint at all_started
PASS -> UNRESOLVED: gdb.threads/attach-into-signal.exp: threaded: attach
new FAIL: gdb.threads/attach-into-signal.exp: threaded: thread apply 2 print $_siginfo.si_signo
FAIL -> UNRESOLVED: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: inferior 1 exited
PASS -> FAIL: gdb.threads/interrupted-hand-call.exp: continue until exit
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m64

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/2/builds/3363

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i3
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m32, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-native-gdbserver-m32

Worker:
        fedora-x86-64-3

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/24/builds/3375

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=1: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=1: print re_run_var_2
new UNRESOLVED: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=2: delete all breakpoints in delete_breakpoints
PASS -> UNRESOLVED: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=2: setting breakpoint at all_started
PASS -> FAIL: gdb.trace/mi-tsv-changed.exp: create delete modify: tvariable $tvar3 modified
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m32/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m64, branch master

gdb-buildbot-2
In reply to this post by Sourceware - gdb-testers mailing list
Buildername:
        Fedora-x86_64-native-gdbserver-m64

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/22/builds/3374

Author:
        Andrew Burgess <[hidden email]>

Commit tested:
        c9debfb97e052c32cf0308157cae529ce2059f48

Subject of commit:
        gdb: Convert language la_get_symbol_name_matcher field to a method

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=1: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=1: print re_run_var_1
new UNRESOLVED: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: delete all breakpoints in delete_breakpoints
PASS -> UNRESOLVED: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: setting breakpoint at all_started
PASS -> FAIL: gdb.threads/interrupted-hand-call.exp: continue until exit
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i02
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i12
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i22
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 2nd stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 2nd stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i3
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/c9/c9debfb97e052c32cf0308157cae529ce2059f48//xfail.table.gz>