public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@gdb-buildbot.osci.io
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdb: Convert language la_parser field to a method
Date: Thu, 23 Jul 2020 10:48:38 -0400 (EDT)	[thread overview]
Message-ID: <87afa6523b01cd6bdcc3903fe22953966cec7bb7@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 87afa6523b01cd6bdcc3903fe22953966cec7bb7 ***

commit 87afa6523b01cd6bdcc3903fe22953966cec7bb7
Author:     Andrew Burgess <andrew.burgess@embecosm.com>
AuthorDate: Tue Jun 2 14:48:04 2020 +0100
Commit:     Andrew Burgess <andrew.burgess@embecosm.com>
CommitDate: Tue Jun 23 13:34:10 2020 +0100

    gdb: Convert language la_parser field to a method
    
    This commit changes the language_data::la_parser function pointer
    member variable into a member function of language_defn.
    
    There should be no user visible changes after this commit.
    
    gdb/ChangeLog:
    
            * ada-lang.c (parse): Rename to ada_language::parser.
            (ada_language_data): Delete la_parser initializer.
            (ada_language::parser): New member function, implementation from
            parse.
            * c-lang.c (c_language_data): Delete la_parser initializer.
            (cplus_language_data): Likewise.
            (asm_language_data): Likewise.
            (minimal_language_data): Likewise.
            * d-lang.c (d_language_data): Likewise.
            (d_language::parser): New member function.
            * f-lang.c (f_language_data): Delete la_parser initializer.
            (f_language::parser): New member function.
            * go-lang.c (go_language_data): Delete la_parser initializer.
            (go_language::parser): New member function.
            * language.c (unk_lang_parser): Delete.
            (language_defn::parser): Define new member function.
            (unknown_language_data): Delete la_parser initializer.
            (unknown_language::parser): New member function.
            (auto_language_data): Delete la_parser initializer.
            (auto_language::parser): New member function.
            * language.h (language_data): Delete la_parser field.
            (language_defn::parser): Declare new member function.
            * m2-lang.c (m2_language_data): Delete la_parser initializer.
            (m2_language::parser): New member function.
            * objc-lang.c (objc_language_data): Delete la_parser initializer.
            * opencl-lang.c (opencl_language_data): Likewise.
            * p-lang.c (pascal_language_data): Likewise.
            (pascal_language::parser): New member function.
            * parse.c (parse_exp_in_context): Update call to parser.
            * rust-lang.c (rust_language_data): Delete la_parser initializer.
            (rust_language::parser): New member function.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf1c037cc7..a0e120d676 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,37 @@
+2020-06-23  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* ada-lang.c (parse): Rename to ada_language::parser.
+	(ada_language_data): Delete la_parser initializer.
+	(ada_language::parser): New member function, implementation from
+	parse.
+	* c-lang.c (c_language_data): Delete la_parser initializer.
+	(cplus_language_data): Likewise.
+	(asm_language_data): Likewise.
+	(minimal_language_data): Likewise.
+	* d-lang.c (d_language_data): Likewise.
+	(d_language::parser): New member function.
+	* f-lang.c (f_language_data): Delete la_parser initializer.
+	(f_language::parser): New member function.
+	* go-lang.c (go_language_data): Delete la_parser initializer.
+	(go_language::parser): New member function.
+	* language.c (unk_lang_parser): Delete.
+	(language_defn::parser): Define new member function.
+	(unknown_language_data): Delete la_parser initializer.
+	(unknown_language::parser): New member function.
+	(auto_language_data): Delete la_parser initializer.
+	(auto_language::parser): New member function.
+	* language.h (language_data): Delete la_parser field.
+	(language_defn::parser): Declare new member function.
+	* m2-lang.c (m2_language_data): Delete la_parser initializer.
+	(m2_language::parser): New member function.
+	* objc-lang.c (objc_language_data): Delete la_parser initializer.
+	* opencl-lang.c (opencl_language_data): Likewise.
+	* p-lang.c (pascal_language_data): Likewise.
+	(pascal_language::parser): New member function.
+	* parse.c (parse_exp_in_context): Update call to parser.
+	* rust-lang.c (rust_language_data): Delete la_parser initializer.
+	(rust_language::parser): New member function.
+
 2020-06-23  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* top.c (print_gdb_configuration): Print --with-python-libdir
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index d303915ebd..c4ee79eb8d 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -13534,13 +13534,6 @@ emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
   ada_emit_char (c, type, stream, quoter, 1);
 }
 
-static int
-parse (struct parser_state *ps)
-{
-  warnings_issued = 0;
-  return ada_parse (ps);
-}
-
 static const struct exp_descriptor ada_exp_descriptor = {
   ada_print_subexp,
   ada_operator_length,
@@ -13718,7 +13711,6 @@ extern const struct language_data ada_language_data =
   macro_expansion_no,
   ada_extensions,
   &ada_exp_descriptor,
-  parse,
   resolve,
   ada_printchar,                /* Print a character constant */
   ada_printstr,                 /* Function to print string constant */
@@ -14116,6 +14108,14 @@ public:
     return {};
   }
 
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    warnings_issued = 0;
+    return ada_parse (ps);
+  }
+
 protected:
   /* See language.h.  */
 
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 64dfd71399..37e69d433f 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -889,7 +889,6 @@ extern const struct language_data c_language_data =
   macro_expansion_c,
   c_extensions,
   &exp_descriptor_c,
-  c_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
@@ -997,7 +996,6 @@ extern const struct language_data cplus_language_data =
   macro_expansion_c,
   cplus_extensions,
   &exp_descriptor_c,
-  c_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
@@ -1202,7 +1200,6 @@ extern const struct language_data asm_language_data =
   macro_expansion_c,
   asm_extensions,
   &exp_descriptor_c,
-  c_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
@@ -1265,7 +1262,6 @@ extern const struct language_data minimal_language_data =
   macro_expansion_c,
   NULL,
   &exp_descriptor_c,
-  c_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
diff --git a/gdb/d-lang.c b/gdb/d-lang.c
index 5689b6ceaf..e2765b5671 100644
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -142,7 +142,6 @@ extern const struct language_data d_language_data =
   macro_expansion_no,
   d_extensions,
   &exp_descriptor_c,
-  d_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant.  */
   c_printstr,			/* Function to print string constant.  */
@@ -273,6 +272,13 @@ public:
   {
     return d_lookup_symbol_nonlocal (this, name, block, domain);
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    return d_parse (ps);
+  }
 };
 
 /* Single instance of the D language class.  */
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index db337be26b..918a8cfd3d 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -564,7 +564,6 @@ extern const struct language_data f_language_data =
   macro_expansion_no,
   f_extensions,
   &exp_descriptor_f,
-  f_parse,			/* parser */
   null_post_parser,
   f_printchar,			/* Print character constant */
   f_printstr,			/* function to print string constant */
@@ -713,6 +712,13 @@ public:
     return cp_lookup_symbol_nonlocal (this, name, block, domain);
   }
 
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    return f_parse (ps);
+  }
+
 protected:
 
   /* See language.h.  */
diff --git a/gdb/go-lang.c b/gdb/go-lang.c
index 7da9299fdd..f2553bb399 100644
--- a/gdb/go-lang.c
+++ b/gdb/go-lang.c
@@ -527,7 +527,6 @@ extern const struct language_data go_language_data =
   macro_expansion_no,
   NULL,
   &exp_descriptor_c,
-  go_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant.  */
   c_printstr,			/* Function to print string constant.  */
@@ -638,6 +637,13 @@ public:
   {
     return go_value_print_inner (val, stream, recurse, options);
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    return go_parse (ps);
+  }
 };
 
 /* Single instance of the Go language class.  */
diff --git a/gdb/language.c b/gdb/language.c
index 0cbc7f0540..828d21dc7e 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -47,8 +47,6 @@
 #include <algorithm>
 #include "gdbarch.h"
 
-static int unk_lang_parser (struct parser_state *);
-
 static void set_range_case (void);
 
 static void unk_lang_emit_char (int c, struct type *type,
@@ -643,6 +641,14 @@ language_defn::value_print (struct value *val, struct ui_file *stream,
 
 /* See language.h.  */
 
+int
+language_defn::parser (struct parser_state *ps) const
+{
+  return c_parse (ps);
+}
+
+/* See language.h.  */
+
 void
 language_defn::value_print_inner
 	(struct value *val, struct ui_file *stream, int recurse,
@@ -718,12 +724,6 @@ default_is_string_type_p (struct type *type)
 
 /* Define the language that is no language.  */
 
-static int
-unk_lang_parser (struct parser_state *ps)
-{
-  return 1;
-}
-
 static void
 unk_lang_emit_char (int c, struct type *type, struct ui_file *stream,
 		    int quoter)
@@ -777,7 +777,6 @@ extern const struct language_data unknown_language_data =
   macro_expansion_no,
   NULL,
   &exp_descriptor_standard,
-  unk_lang_parser,
   null_post_parser,
   unk_lang_printchar,		/* Print character constant */
   unk_lang_printstr,
@@ -842,6 +841,14 @@ public:
   {
     error (_("unimplemented unknown_language::value_print_inner called"));
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    /* No parsing is done, just claim success.  */
+    return 1;
+  }
 };
 
 /* Single instance of the unknown language class.  */
@@ -861,7 +868,6 @@ extern const struct language_data auto_language_data =
   macro_expansion_no,
   NULL,
   &exp_descriptor_standard,
-  unk_lang_parser,
   null_post_parser,
   unk_lang_printchar,		/* Print character constant */
   unk_lang_printstr,
@@ -926,6 +932,14 @@ public:
   {
     error (_("unimplemented auto_language::value_print_inner called"));
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    /* No parsing is done, just claim success.  */
+    return 1;
+  }
 };
 
 /* Single instance of the fake "auto" language.  */
diff --git a/gdb/language.h b/gdb/language.h
index 2149487dd7..7434d74523 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -225,10 +225,6 @@ struct language_data
 
     const struct exp_descriptor *la_exp_desc;
 
-    /* Parser function.  */
-
-    int (*la_parser) (struct parser_state *);
-
     /* Given an expression *EXPP created by prefixifying the result of
        la_parser, perform any remaining processing necessary to complete
        its translation.  *EXPP may change; la_post_parser is responsible 
@@ -540,6 +536,10 @@ struct language_defn : language_data
 	(struct value *val, struct ui_file *stream, int recurse,
 	 const struct value_print_options *options) const;
 
+  /* Parser function.  */
+
+  virtual int parser (struct parser_state *ps) const;
+
 protected:
 
   /* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 356ed4c3bf..189f513605 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -362,7 +362,6 @@ extern const struct language_data m2_language_data =
   macro_expansion_no,
   NULL,
   &exp_descriptor_modula2,
-  m2_parse,			/* parser */
   null_post_parser,
   m2_printchar,			/* Print character constant */
   m2_printstr,			/* function to print string constant */
@@ -430,6 +429,13 @@ public:
   {
     return m2_value_print_inner (val, stream, recurse, options);
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    return m2_parse (ps);
+  }
 };
 
 /* Single instance of the M2 language.  */
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 1e4862fe3f..90804acc16 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -337,7 +337,6 @@ extern const struct language_data objc_language_data =
   macro_expansion_c,
   objc_extensions,
   &exp_descriptor_standard,
-  c_parse,
   null_post_parser,
   c_printchar,		       /* Print a character constant */
   c_printstr,		       /* Function to print string constant */
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index 2a83f51f5c..7c9965814f 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -1016,7 +1016,6 @@ extern const struct language_data opencl_language_data =
   macro_expansion_c,
   NULL,
   &exp_descriptor_opencl,
-  c_parse,
   null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 5c1b273e7f..ce812d1d30 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -393,7 +393,6 @@ extern const struct language_data pascal_language_data =
   macro_expansion_no,
   p_extensions,
   &exp_descriptor_standard,
-  pascal_parse,
   null_post_parser,
   pascal_printchar,		/* Print a character constant */
   pascal_printstr,		/* Function to print string constant */
@@ -492,6 +491,13 @@ public:
   {
     return pascal_value_print_inner (val, stream, recurse, options);
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    return pascal_parse (ps);
+  }
 };
 
 /* Single instance of the Pascal language class.  */
diff --git a/gdb/parse.c b/gdb/parse.c
index d5efe4ab3d..f003a30baf 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1119,7 +1119,7 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
 
   try
     {
-      lang->la_parser (&ps);
+      lang->parser (&ps);
     }
   catch (const gdb_exception &except)
     {
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index d251dab29f..2153323cff 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -1989,7 +1989,6 @@ extern const struct language_data rust_language_data =
   macro_expansion_no,
   rust_extensions,
   &exp_descriptor_rust,
-  rust_parse,
   null_post_parser,
   rust_printchar,		/* Print a character constant */
   rust_printstr,		/* Function to print string constant */
@@ -2142,6 +2141,13 @@ public:
       }
     return result;
   }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    return rust_parse (ps);
+  }
 };
 
 /* Single instance of the Rust language class.  */


             reply	other threads:[~2020-07-23 14:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 14:48 gdb-buildbot [this message]
2020-07-23 14:48 ` *** COMPILATION FAILED *** Failures on Fedora-i686, branch master *** BREAKAGE *** gdb-buildbot
2020-07-23 15:25 ` Failures on Fedora-x86_64-cc-with-index, branch master gdb-buildbot
2020-07-23 15:40 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-07-23 15:59 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-07-23 16:24 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-07-23 16:46 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-07-23 17:00 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-07-23 17:25 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87afa6523b01cd6bdcc3903fe22953966cec7bb7@gdb-build \
    --to=gdb-buildbot@gdb-buildbot.osci.io \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).