aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-08-04 16:31:56 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-09-16 11:04:04 +0100
commit5aba6ebefb9488163c82e198b73ecf0a05a5d1fd (patch)
tree06bbdb7350491a54168495262b53e032a12b0691 /gdb/c-lang.c
parentb63a3f3fc4e998b4efd5fd49aa0eb044e9cee261 (diff)
downloadgdb-5aba6ebefb9488163c82e198b73ecf0a05a5d1fd.zip
gdb-5aba6ebefb9488163c82e198b73ecf0a05a5d1fd.tar.gz
gdb-5aba6ebefb9488163c82e198b73ecf0a05a5d1fd.tar.bz2
gdb: Convert language_data::la_exp_desc to a method
Convert language_data::la_exp_desc member variable to a virtual method language_defn::expression_ops. The change of names brings this method more into line with the existing varobj_ops method, that also returns a table of function pointers. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Remove la_exp_desc initializer. (ada_language::expression_ops): New member function. * c-lang.c (c_language_data): Remove la_exp_desc initializer. (c_language::expression_ops): New member function. (cplus_language_data): Remove la_exp_desc initializer. (cplus_language::expression_ops): New member function. (asm_language_data): Remove la_exp_desc initializer. (asm_language::expression_ops): New member function. (minimal_language_data): Remove la_exp_desc initializer. (minimal_language::expression_ops): New member function. * d-lang.c (d_language_data): Remove la_exp_desc initializer. (d_language::expression_ops): New member function. * eval.c (evaluate_subexp): Update call to expression_ops. * expprint.c (print_subexp): Likewise. (op_name): Likewise. (dump_subexp_body): Likewise. * f-lang.c (f_language_data): Remove la_exp_desc initializer. (f_language::expression_ops): New member function. * go-lang.c (go_language_data): Remove la_exp_desc initializer. (go_language::expression_ops): New member function. * language.c (language_defn::expression_ops): New function. (unknown_language_data): Remove la_exp_desc initializer. (auto_language_data): Likewise. * language.h (language_data): Remove la_exp_desc field. (language_defn::expression_ops): Declare new member function. * m2-lang.c (m2_language_data): Remove la_exp_desc initializer. (m2_language::expression_ops): New member function. * objc-lang.c (objc_language_data): Remove la_exp_desc initializer. * opencl-lang.c (opencl_language_data): Remove la_exp_desc initializer. (opencl_language::expression_ops): New member function. * p-lang.c (pascal_language_data): Remove la_exp_desc initializer. * parse.c (operator_length): Update call to expression_ops. (exp_iterate): Likewise. * rust-lang.c (rust_language_data): Remove la_exp_desc initializer. (ruse_language::expression_ops): New member function.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 9b21da1..f29f340 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -875,7 +875,6 @@ const struct exp_descriptor exp_descriptor_c =
extern const struct language_data c_language_data =
{
- &exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
};
@@ -947,6 +946,11 @@ public:
enum macro_expansion macro_expansion () const override
{ return macro_expansion_c; }
+
+ /* See language.h. */
+
+ const struct exp_descriptor *expression_ops () const override
+ { return &exp_descriptor_c; }
};
/* Single instance of the C language class. */
@@ -985,7 +989,6 @@ enum cplus_primitive_types {
extern const struct language_data cplus_language_data =
{
- &exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
};
@@ -1179,6 +1182,11 @@ public:
const struct lang_varobj_ops *varobj_ops () const override
{ return &cplus_varobj_ops; }
+ /* See language.h. */
+
+ const struct exp_descriptor *expression_ops () const override
+ { return &exp_descriptor_c; }
+
protected:
/* See language.h. */
@@ -1198,7 +1206,6 @@ static cplus_language cplus_language_defn;
extern const struct language_data asm_language_data =
{
- &exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
};
@@ -1257,6 +1264,11 @@ public:
enum macro_expansion macro_expansion () const override
{ return macro_expansion_c; }
+
+ /* See language.h. */
+
+ const struct exp_descriptor *expression_ops () const override
+ { return &exp_descriptor_c; }
};
/* The single instance of the ASM language class. */
@@ -1269,7 +1281,6 @@ static asm_language asm_language_defn;
extern const struct language_data minimal_language_data =
{
- &exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
};
@@ -1317,6 +1328,11 @@ public:
enum macro_expansion macro_expansion () const override
{ return macro_expansion_c; }
+
+ /* See language.h. */
+
+ const struct exp_descriptor *expression_ops () const override
+ { return &exp_descriptor_c; }
};
/* The single instance of the minimal language class. */