• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisão87afa6523b01cd6bdcc3903fe22953966cec7bb7 (tree)
Hora2020-06-23 21:34:10
AutorAndrew Burgess <andrew.burgess@embe...>
CommiterAndrew Burgess

Mensagem de Log

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.

Mudança Sumário

Diff

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,39 @@
11 2020-06-23 Andrew Burgess <andrew.burgess@embecosm.com>
22
3+ * ada-lang.c (parse): Rename to ada_language::parser.
4+ (ada_language_data): Delete la_parser initializer.
5+ (ada_language::parser): New member function, implementation from
6+ parse.
7+ * c-lang.c (c_language_data): Delete la_parser initializer.
8+ (cplus_language_data): Likewise.
9+ (asm_language_data): Likewise.
10+ (minimal_language_data): Likewise.
11+ * d-lang.c (d_language_data): Likewise.
12+ (d_language::parser): New member function.
13+ * f-lang.c (f_language_data): Delete la_parser initializer.
14+ (f_language::parser): New member function.
15+ * go-lang.c (go_language_data): Delete la_parser initializer.
16+ (go_language::parser): New member function.
17+ * language.c (unk_lang_parser): Delete.
18+ (language_defn::parser): Define new member function.
19+ (unknown_language_data): Delete la_parser initializer.
20+ (unknown_language::parser): New member function.
21+ (auto_language_data): Delete la_parser initializer.
22+ (auto_language::parser): New member function.
23+ * language.h (language_data): Delete la_parser field.
24+ (language_defn::parser): Declare new member function.
25+ * m2-lang.c (m2_language_data): Delete la_parser initializer.
26+ (m2_language::parser): New member function.
27+ * objc-lang.c (objc_language_data): Delete la_parser initializer.
28+ * opencl-lang.c (opencl_language_data): Likewise.
29+ * p-lang.c (pascal_language_data): Likewise.
30+ (pascal_language::parser): New member function.
31+ * parse.c (parse_exp_in_context): Update call to parser.
32+ * rust-lang.c (rust_language_data): Delete la_parser initializer.
33+ (rust_language::parser): New member function.
34+
35+2020-06-23 Andrew Burgess <andrew.burgess@embecosm.com>
36+
337 * top.c (print_gdb_configuration): Print --with-python-libdir
438 configuration value.
539
--- 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)
1353413534 ada_emit_char (c, type, stream, quoter, 1);
1353513535 }
1353613536
13537-static int
13538-parse (struct parser_state *ps)
13539-{
13540- warnings_issued = 0;
13541- return ada_parse (ps);
13542-}
13543-
1354413537 static const struct exp_descriptor ada_exp_descriptor = {
1354513538 ada_print_subexp,
1354613539 ada_operator_length,
@@ -13718,7 +13711,6 @@ extern const struct language_data ada_language_data =
1371813711 macro_expansion_no,
1371913712 ada_extensions,
1372013713 &ada_exp_descriptor,
13721- parse,
1372213714 resolve,
1372313715 ada_printchar, /* Print a character constant */
1372413716 ada_printstr, /* Function to print string constant */
@@ -14116,6 +14108,14 @@ public:
1411614108 return {};
1411714109 }
1411814110
14111+ /* See language.h. */
14112+
14113+ int parser (struct parser_state *ps) const override
14114+ {
14115+ warnings_issued = 0;
14116+ return ada_parse (ps);
14117+ }
14118+
1411914119 protected:
1412014120 /* See language.h. */
1412114121
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -889,7 +889,6 @@ extern const struct language_data c_language_data =
889889 macro_expansion_c,
890890 c_extensions,
891891 &exp_descriptor_c,
892- c_parse,
893892 null_post_parser,
894893 c_printchar, /* Print a character constant */
895894 c_printstr, /* Function to print string constant */
@@ -997,7 +996,6 @@ extern const struct language_data cplus_language_data =
997996 macro_expansion_c,
998997 cplus_extensions,
999998 &exp_descriptor_c,
1000- c_parse,
1001999 null_post_parser,
10021000 c_printchar, /* Print a character constant */
10031001 c_printstr, /* Function to print string constant */
@@ -1202,7 +1200,6 @@ extern const struct language_data asm_language_data =
12021200 macro_expansion_c,
12031201 asm_extensions,
12041202 &exp_descriptor_c,
1205- c_parse,
12061203 null_post_parser,
12071204 c_printchar, /* Print a character constant */
12081205 c_printstr, /* Function to print string constant */
@@ -1265,7 +1262,6 @@ extern const struct language_data minimal_language_data =
12651262 macro_expansion_c,
12661263 NULL,
12671264 &exp_descriptor_c,
1268- c_parse,
12691265 null_post_parser,
12701266 c_printchar, /* Print a character constant */
12711267 c_printstr, /* Function to print string constant */
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -142,7 +142,6 @@ extern const struct language_data d_language_data =
142142 macro_expansion_no,
143143 d_extensions,
144144 &exp_descriptor_c,
145- d_parse,
146145 null_post_parser,
147146 c_printchar, /* Print a character constant. */
148147 c_printstr, /* Function to print string constant. */
@@ -273,6 +272,13 @@ public:
273272 {
274273 return d_lookup_symbol_nonlocal (this, name, block, domain);
275274 }
275+
276+ /* See language.h. */
277+
278+ int parser (struct parser_state *ps) const override
279+ {
280+ return d_parse (ps);
281+ }
276282 };
277283
278284 /* Single instance of the D language class. */
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -564,7 +564,6 @@ extern const struct language_data f_language_data =
564564 macro_expansion_no,
565565 f_extensions,
566566 &exp_descriptor_f,
567- f_parse, /* parser */
568567 null_post_parser,
569568 f_printchar, /* Print character constant */
570569 f_printstr, /* function to print string constant */
@@ -713,6 +712,13 @@ public:
713712 return cp_lookup_symbol_nonlocal (this, name, block, domain);
714713 }
715714
715+ /* See language.h. */
716+
717+ int parser (struct parser_state *ps) const override
718+ {
719+ return f_parse (ps);
720+ }
721+
716722 protected:
717723
718724 /* See language.h. */
--- a/gdb/go-lang.c
+++ b/gdb/go-lang.c
@@ -527,7 +527,6 @@ extern const struct language_data go_language_data =
527527 macro_expansion_no,
528528 NULL,
529529 &exp_descriptor_c,
530- go_parse,
531530 null_post_parser,
532531 c_printchar, /* Print a character constant. */
533532 c_printstr, /* Function to print string constant. */
@@ -638,6 +637,13 @@ public:
638637 {
639638 return go_value_print_inner (val, stream, recurse, options);
640639 }
640+
641+ /* See language.h. */
642+
643+ int parser (struct parser_state *ps) const override
644+ {
645+ return go_parse (ps);
646+ }
641647 };
642648
643649 /* Single instance of the Go language class. */
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -47,8 +47,6 @@
4747 #include <algorithm>
4848 #include "gdbarch.h"
4949
50-static int unk_lang_parser (struct parser_state *);
51-
5250 static void set_range_case (void);
5351
5452 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,
643641
644642 /* See language.h. */
645643
644+int
645+language_defn::parser (struct parser_state *ps) const
646+{
647+ return c_parse (ps);
648+}
649+
650+/* See language.h. */
651+
646652 void
647653 language_defn::value_print_inner
648654 (struct value *val, struct ui_file *stream, int recurse,
@@ -718,12 +724,6 @@ default_is_string_type_p (struct type *type)
718724
719725 /* Define the language that is no language. */
720726
721-static int
722-unk_lang_parser (struct parser_state *ps)
723-{
724- return 1;
725-}
726-
727727 static void
728728 unk_lang_emit_char (int c, struct type *type, struct ui_file *stream,
729729 int quoter)
@@ -777,7 +777,6 @@ extern const struct language_data unknown_language_data =
777777 macro_expansion_no,
778778 NULL,
779779 &exp_descriptor_standard,
780- unk_lang_parser,
781780 null_post_parser,
782781 unk_lang_printchar, /* Print character constant */
783782 unk_lang_printstr,
@@ -842,6 +841,14 @@ public:
842841 {
843842 error (_("unimplemented unknown_language::value_print_inner called"));
844843 }
844+
845+ /* See language.h. */
846+
847+ int parser (struct parser_state *ps) const override
848+ {
849+ /* No parsing is done, just claim success. */
850+ return 1;
851+ }
845852 };
846853
847854 /* Single instance of the unknown language class. */
@@ -861,7 +868,6 @@ extern const struct language_data auto_language_data =
861868 macro_expansion_no,
862869 NULL,
863870 &exp_descriptor_standard,
864- unk_lang_parser,
865871 null_post_parser,
866872 unk_lang_printchar, /* Print character constant */
867873 unk_lang_printstr,
@@ -926,6 +932,14 @@ public:
926932 {
927933 error (_("unimplemented auto_language::value_print_inner called"));
928934 }
935+
936+ /* See language.h. */
937+
938+ int parser (struct parser_state *ps) const override
939+ {
940+ /* No parsing is done, just claim success. */
941+ return 1;
942+ }
929943 };
930944
931945 /* Single instance of the fake "auto" language. */
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -225,10 +225,6 @@ struct language_data
225225
226226 const struct exp_descriptor *la_exp_desc;
227227
228- /* Parser function. */
229-
230- int (*la_parser) (struct parser_state *);
231-
232228 /* Given an expression *EXPP created by prefixifying the result of
233229 la_parser, perform any remaining processing necessary to complete
234230 its translation. *EXPP may change; la_post_parser is responsible
@@ -540,6 +536,10 @@ struct language_defn : language_data
540536 (struct value *val, struct ui_file *stream, int recurse,
541537 const struct value_print_options *options) const;
542538
539+ /* Parser function. */
540+
541+ virtual int parser (struct parser_state *ps) const;
542+
543543 protected:
544544
545545 /* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -362,7 +362,6 @@ extern const struct language_data m2_language_data =
362362 macro_expansion_no,
363363 NULL,
364364 &exp_descriptor_modula2,
365- m2_parse, /* parser */
366365 null_post_parser,
367366 m2_printchar, /* Print character constant */
368367 m2_printstr, /* function to print string constant */
@@ -430,6 +429,13 @@ public:
430429 {
431430 return m2_value_print_inner (val, stream, recurse, options);
432431 }
432+
433+ /* See language.h. */
434+
435+ int parser (struct parser_state *ps) const override
436+ {
437+ return m2_parse (ps);
438+ }
433439 };
434440
435441 /* Single instance of the M2 language. */
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -337,7 +337,6 @@ extern const struct language_data objc_language_data =
337337 macro_expansion_c,
338338 objc_extensions,
339339 &exp_descriptor_standard,
340- c_parse,
341340 null_post_parser,
342341 c_printchar, /* Print a character constant */
343342 c_printstr, /* Function to print string constant */
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -1016,7 +1016,6 @@ extern const struct language_data opencl_language_data =
10161016 macro_expansion_c,
10171017 NULL,
10181018 &exp_descriptor_opencl,
1019- c_parse,
10201019 null_post_parser,
10211020 c_printchar, /* Print a character constant */
10221021 c_printstr, /* Function to print string constant */
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -393,7 +393,6 @@ extern const struct language_data pascal_language_data =
393393 macro_expansion_no,
394394 p_extensions,
395395 &exp_descriptor_standard,
396- pascal_parse,
397396 null_post_parser,
398397 pascal_printchar, /* Print a character constant */
399398 pascal_printstr, /* Function to print string constant */
@@ -492,6 +491,13 @@ public:
492491 {
493492 return pascal_value_print_inner (val, stream, recurse, options);
494493 }
494+
495+ /* See language.h. */
496+
497+ int parser (struct parser_state *ps) const override
498+ {
499+ return pascal_parse (ps);
500+ }
495501 };
496502
497503 /* Single instance of the Pascal language class. */
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1119,7 +1119,7 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
11191119
11201120 try
11211121 {
1122- lang->la_parser (&ps);
1122+ lang->parser (&ps);
11231123 }
11241124 catch (const gdb_exception &except)
11251125 {
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -1989,7 +1989,6 @@ extern const struct language_data rust_language_data =
19891989 macro_expansion_no,
19901990 rust_extensions,
19911991 &exp_descriptor_rust,
1992- rust_parse,
19931992 null_post_parser,
19941993 rust_printchar, /* Print a character constant */
19951994 rust_printstr, /* Function to print string constant */
@@ -2142,6 +2141,13 @@ public:
21422141 }
21432142 return result;
21442143 }
2144+
2145+ /* See language.h. */
2146+
2147+ int parser (struct parser_state *ps) const override
2148+ {
2149+ return rust_parse (ps);
2150+ }
21452151 };
21462152
21472153 /* Single instance of the Rust language class. */