diff options
-rw-r--r-- | gdb/ChangeLog | 32 | ||||
-rw-r--r-- | gdb/ada-lang.c | 1 | ||||
-rw-r--r-- | gdb/c-lang.c | 24 | ||||
-rw-r--r-- | gdb/d-lang.c | 1 | ||||
-rw-r--r-- | gdb/f-lang.c | 1 | ||||
-rw-r--r-- | gdb/go-lang.c | 1 | ||||
-rw-r--r-- | gdb/language.c | 2 | ||||
-rw-r--r-- | gdb/language.h | 9 | ||||
-rw-r--r-- | gdb/m2-lang.c | 1 | ||||
-rw-r--r-- | gdb/objc-lang.c | 6 | ||||
-rw-r--r-- | gdb/opencl-lang.c | 6 | ||||
-rw-r--r-- | gdb/p-lang.c | 1 | ||||
-rw-r--r-- | gdb/rust-lang.c | 1 | ||||
-rw-r--r-- | gdb/symtab.c | 2 |
14 files changed, 69 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d8988e4..4478628 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,37 @@ 2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com> + * ada-lang.c (ada_language_data): Remove la_macro_expansion + initializer. + * c-lang.c (c_language_data): Likewise. + (c_language::macro_expansion): New member function. + (cplus_language_data): Likewise. + (cplus_language::macro_expansion): New member function. + (asm_language_data): Likewise. + (asm_language::macro_expansion): New member function. + (minimal_language_data): Likewise. + (minimal_language::macro_expansion): New member function. + * d-lang.c (d_language_data): Remove la_macro_expansion + initializer. + * f-lang.c (f_language_data): Likewise. + * go-lang.c (go_language_data): Likewise. + * language.c (unknown_language_data): Likewise. + (auto_language_data): Likewise. + * language.h (language_data): Remove la_macro_expansion field. + (language_defn::macro_expansion): New member function. + * m2-lang.c (m2_language_data): Remove la_macro_expansion + initializer. + * objc-lang.c (objc_language_data): Likewise. + (objc_language::macro_expansion): New member function. + * opencl-lang.c (opencl_language_data): Likewise. + (opencl_language::macro_expansion): New member function. + * p-lang.c (pascal_language_data): Remove la_macro_expansion + initializer. + * rust-lang.c (rust_language_data): Likewise. + * symtab.c (default_collect_symbol_completion_matches_break_on): + Update call to macro_expansion. + +2020-09-16 Andrew Burgess <andrew.burgess@embecosm.com> + * ada-lang.c (ada_language_data): Remove la_array_ordering initializer. * c-lang.c (c_language_data): Likewise. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 9d020d7..43b3af1 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -13708,7 +13708,6 @@ ada_get_symbol_name_matcher (const lookup_name_info &lookup_name) extern const struct language_data ada_language_data = { - macro_expansion_no, &ada_exp_descriptor, ada_op_print_tab, /* expression operators for printing */ &ada_varobj_ops, diff --git a/gdb/c-lang.c b/gdb/c-lang.c index e752e50..a478dd8 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 = { - macro_expansion_c, &exp_descriptor_c, c_op_print_tab, /* expression operators for printing */ &c_varobj_ops, @@ -944,6 +943,11 @@ public: bool store_sym_names_in_linkage_form_p () const override { return true; } + + /* See language.h. */ + + enum macro_expansion macro_expansion () const override + { return macro_expansion_c; } }; /* Single instance of the C language class. */ @@ -982,7 +986,6 @@ enum cplus_primitive_types { extern const struct language_data cplus_language_data = { - macro_expansion_c, &exp_descriptor_c, c_op_print_tab, /* expression operators for printing */ &cplus_varobj_ops, @@ -1168,6 +1171,11 @@ public: const char *name_of_this () const override { return "this"; } + /* See language.h. */ + + enum macro_expansion macro_expansion () const override + { return macro_expansion_c; } + protected: /* See language.h. */ @@ -1187,7 +1195,6 @@ static cplus_language cplus_language_defn; extern const struct language_data asm_language_data = { - macro_expansion_c, &exp_descriptor_c, c_op_print_tab, /* expression operators for printing */ &default_varobj_ops, @@ -1243,6 +1250,11 @@ public: bool store_sym_names_in_linkage_form_p () const override { return true; } + + /* See language.h. */ + + enum macro_expansion macro_expansion () const override + { return macro_expansion_c; } }; /* The single instance of the ASM language class. */ @@ -1255,7 +1267,6 @@ static asm_language asm_language_defn; extern const struct language_data minimal_language_data = { - macro_expansion_c, &exp_descriptor_c, c_op_print_tab, /* expression operators for printing */ &default_varobj_ops, @@ -1300,6 +1311,11 @@ public: bool store_sym_names_in_linkage_form_p () const override { return true; } + + /* See language.h. */ + + enum macro_expansion macro_expansion () const override + { return macro_expansion_c; } }; /* The single instance of the minimal language class. */ diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 435d771..3487022 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -128,7 +128,6 @@ enum d_primitive_types { extern const struct language_data d_language_data = { - macro_expansion_no, &exp_descriptor_c, d_op_print_tab, /* Expression operators for printing. */ &default_varobj_ops, diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 67e4e89..cd596b5 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -486,7 +486,6 @@ static const struct exp_descriptor exp_descriptor_f = extern const struct language_data f_language_data = { - macro_expansion_no, &exp_descriptor_f, f_op_print_tab, /* expression operators for printing */ &default_varobj_ops, diff --git a/gdb/go-lang.c b/gdb/go-lang.c index ceda7af..92d2819 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -508,7 +508,6 @@ enum go_primitive_types { extern const struct language_data go_language_data = { - macro_expansion_no, &exp_descriptor_c, go_op_print_tab, /* Expression operators for printing. */ &default_varobj_ops, diff --git a/gdb/language.c b/gdb/language.c index 507c51a..d255035 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -798,7 +798,6 @@ unknown_language_arch_info (struct gdbarch *gdbarch, extern const struct language_data unknown_language_data = { - macro_expansion_no, &exp_descriptor_standard, unk_op_print_tab, /* expression operators for printing */ &default_varobj_ops, @@ -932,7 +931,6 @@ static unknown_language unknown_language_defn; extern const struct language_data auto_language_data = { - macro_expansion_no, &exp_descriptor_standard, unk_op_print_tab, /* expression operators for printing */ &default_varobj_ops, diff --git a/gdb/language.h b/gdb/language.h index 5ec5daa..a2a970e 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -168,9 +168,6 @@ extern const char *default_word_break_characters (void); struct language_data { - /* Style of macro expansion, if any, supported by this language. */ - enum macro_expansion la_macro_expansion; - /* Definitions related to expression printing, prefixifying, and dumping. */ @@ -562,6 +559,12 @@ struct language_defn : language_data virtual enum array_ordering array_ordering () const { return array_row_major; } + /* Style of macro expansion, if any, supported by this language. The + default is no macro expansion. */ + + virtual enum macro_expansion macro_expansion () const + { return macro_expansion_no; } + 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 b587242..ac251af 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -199,7 +199,6 @@ const struct exp_descriptor exp_descriptor_modula2 = extern const struct language_data m2_language_data = { - macro_expansion_no, &exp_descriptor_modula2, m2_op_print_tab, /* expression operators for printing */ &default_varobj_ops, diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 60e0ead..2246e12 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -323,7 +323,6 @@ static const struct op_print objc_op_print_tab[] = extern const struct language_data objc_language_data = { - macro_expansion_c, &exp_descriptor_standard, objc_op_print_tab, /* Expression operators for printing */ &default_varobj_ops, @@ -425,6 +424,11 @@ public: const char *name_of_this () const override { return "self"; } + + /* See language.h. */ + + enum macro_expansion macro_expansion () const override + { return macro_expansion_c; } }; /* Single instance of the class representing the Objective-C language. */ diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index dffdae4..8f19f25 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -1006,7 +1006,6 @@ const struct exp_descriptor exp_descriptor_opencl = /* Constant data representing the OpenCL language. */ extern const struct language_data opencl_language_data = { - macro_expansion_c, &exp_descriptor_opencl, c_op_print_tab, /* expression operators for printing */ &default_varobj_ops, @@ -1067,6 +1066,11 @@ public: c_print_type (type, varstring, stream, show, level, flags); } + + /* See language.h. */ + + enum macro_expansion macro_expansion () const override + { return macro_expansion_c; } }; /* Single instance of the OpenCL language class. */ diff --git a/gdb/p-lang.c b/gdb/p-lang.c index d1e6e69..aa2b9fc 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -252,7 +252,6 @@ enum pascal_primitive_types { extern const struct language_data pascal_language_data = { - macro_expansion_no, &exp_descriptor_standard, pascal_op_print_tab, /* expression operators for printing */ &default_varobj_ops, diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index fb248cd..2c82ddb 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1901,7 +1901,6 @@ static const struct exp_descriptor exp_descriptor_rust = extern const struct language_data rust_language_data = { - macro_expansion_no, &exp_descriptor_rust, c_op_print_tab, /* expression operators for printing */ &default_varobj_ops, diff --git a/gdb/symtab.c b/gdb/symtab.c index 61f96b2..04891c4 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -5768,7 +5768,7 @@ default_collect_symbol_completion_matches_break_on /* Skip macros if we are completing a struct tag -- arguable but usually what is expected. */ - if (current_language->la_macro_expansion == macro_expansion_c + if (current_language->macro_expansion () == macro_expansion_c && code == TYPE_CODE_UNDEF) { gdb::unique_xmalloc_ptr<struct macro_scope> scope; |