summaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-08-04 15:59:52 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-09-16 11:04:03 +0100
commitb63a3f3fc4e998b4efd5fd49aa0eb044e9cee261 (patch)
tree314d88378bc6f02e7679166ec0bdda40d0ecd88e /gdb/c-lang.c
parent1ac14a04025b105c1975ceb3b07245c811518bcb (diff)
downloadbinutils-gdb-b63a3f3fc4e998b4efd5fd49aa0eb044e9cee261.tar.gz
gdb: Convert language_data::la_varobj_ops to a method
Convert language_data::la_varobj_ops member variable to a virtual method language_defn::varobj_ops. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Remove la_varobj_ops initializer. (ada_language::varobj_ops): New member function. * c-lang.c (c_language_data): Remove la_varobj_ops initializer. (cplus_language_data): Likewise. (cplus_language::varobj_ops): New member function. (asm_language_data): Remove la_varobj_ops initializer. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_language_data): Likewise. * go-lang.c (go_language_data): Likewise. * language.c (language_defn::varobj_ops): New function. (unknown_language_data): Remove la_varobj_ops initializer. (auto_language_data): Likewise. * language.h (language_data): Remove la_varobj_ops field. (language_defn::varobj_ops): Declare new member function. * m2-lang.c (m2_language_data): Remove la_varobj_ops initializer. * objc-lang.c (objc_language_data): Likewise. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. * rust-lang.c (rust_language_data): Likewise. * varobj.c (varobj_create): Update call to varobj_ops. * varobj.h (default_varobj_ops): Delete define.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index a478dd81b23..9b21da15044 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -877,7 +877,6 @@ extern const struct language_data c_language_data =
{
&exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
- &c_varobj_ops,
};
/* Class representing the C language. */
@@ -988,7 +987,6 @@ extern const struct language_data cplus_language_data =
{
&exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
- &cplus_varobj_ops,
};
/* A class for the C++ language. */
@@ -1176,6 +1174,11 @@ public:
enum macro_expansion macro_expansion () const override
{ return macro_expansion_c; }
+ /* See language.h. */
+
+ const struct lang_varobj_ops *varobj_ops () const override
+ { return &cplus_varobj_ops; }
+
protected:
/* See language.h. */
@@ -1197,7 +1200,6 @@ extern const struct language_data asm_language_data =
{
&exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
- &default_varobj_ops,
};
/* A class for the ASM language. */
@@ -1269,7 +1271,6 @@ extern const struct language_data minimal_language_data =
{
&exp_descriptor_c,
c_op_print_tab, /* expression operators for printing */
- &default_varobj_ops,
};
/* A class for the minimal language. */