diff options
author | Yao Qi <yao@codesourcery.com> | 2013-10-17 21:15:21 +0800 |
---|---|---|
committer | Tom Tromey <tromey@sourceware.org> | 2013-10-25 14:03:02 +0000 |
commit | a53b64eaa0816d9136f92b51f5e0d23e718b84f3 (patch) | |
tree | 5fe5ffa5cc606ccf84d43873dcf764c8b714f510 /gdb/language.c | |
parent | 38095c27fb67d4828c0b55f37714fe5c8e7dd9cd (diff) | |
download | gdb-a53b64eaa0816d9136f92b51f5e0d23e718b84f3.zip gdb-a53b64eaa0816d9136f92b51f5e0d23e718b84f3.tar.gz gdb-a53b64eaa0816d9136f92b51f5e0d23e718b84f3.tar.bz2 |
New field la_varobj_ops in struct language_defn
This is a follow-up series to move language stuff out of varobj.c.
This patch adds a new field la_varobj_ops in struct language_defn so
that each language has varobj-related options. Not every language
supports varobj, and the operations are identical to operations of c
languages.
'struct language_defn' is the ideal place to save all language-related
operations. After this patch, some cleanups can be done in patch 2/2,
which removes language-related stuff completely from varobj.c.
Regression tested on x86_64-linux.
gdb:
2013-10-25 Yao Qi <yao@codesourcery.com>
* language.h (struct lang_varobj_ops): Declare.
(struct language_defn) <la_varobj_ops>: New field.
* ada-lang.c: Include "varobj.h"
(defn ada_language_defn): Initialize field 'la_varobj_ops' by
ada_varobj_ops.
* c-lang.c: Include "varobj.h"
(c_language_defn): Initialize field 'la_varobj_ops' by
c_varobj_ops.
(cplus_language_defn): Initialize field 'la_varobj_ops' by
cplus_varobj_ops.
(asm_language_defn): Initialize field 'la_varobj_ops' by
default_varobj_ops.
(minimal_language_defn): Likewise.
* d-lang.c (d_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* go-lang.c (go_language_defn): Likewise.
* m2-lang.c (m2_language_defn): Likewise.
* objc-lang.c (objc_language_defn): Likewise.
* opencl-lang.c (opencl_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* language.c (unknown_language_defn): Likewise.
(auto_language_defn): Likewise.
(local_language_defn): Likewise.
* jv-lang.c (java_language_defn): Initialize field
'la_varobj_ops' by java_varobj_ops.
* varobj.c (varobj_create): Update.
* varobj.h (default_varobj_ops): Define macro.
Diffstat (limited to 'gdb/language.c')
-rw-r--r-- | gdb/language.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/language.c b/gdb/language.c index 10073e1..dcad5f3 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -38,6 +38,7 @@ #include "gdbcmd.h" #include "expression.h" #include "language.h" +#include "varobj.h" #include "target.h" #include "parser-defs.h" #include "jv-lang.h" @@ -826,6 +827,7 @@ const struct language_defn unknown_language_defn = default_get_string, NULL, /* la_get_symbol_name_cmp */ iterate_over_symbols, + &default_varobj_ops, LANG_MAGIC }; @@ -869,6 +871,7 @@ const struct language_defn auto_language_defn = default_get_string, NULL, /* la_get_symbol_name_cmp */ iterate_over_symbols, + &default_varobj_ops, LANG_MAGIC }; @@ -910,6 +913,7 @@ const struct language_defn local_language_defn = default_get_string, NULL, /* la_get_symbol_name_cmp */ iterate_over_symbols, + &default_varobj_ops, LANG_MAGIC }; |