+2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data) Delete
+ la_class_name_from_physname initializer.
+ * c-lang.c (c_language_data): Likewise.
+ (cplus_language_data): Likewise.
+ (cplus_language::class_name_from_physname): New member function.
+ (asm_language_data): Delete la_class_name_from_physname
+ initializer.
+ (minimal_language_data): Likewise.
+ * d-lang.c (d_language_data): Likewise.
+ * dwarf2/read.c (guess_partial_die_structure_name): Update to call
+ method on language_defn class.
+ (guess_full_die_structure_name): Likewise.
+ * f-lang.c (f_language_data): Delete la_class_name_from_physname
+ initializer.
+ * go-lang.c (go_language_data): Likewise.
+ * language.c (language_class_name_from_physname): Delete.
+ (unk_lang_class_name): Delete.
+ (unknown_language_data): Delete la_class_name_from_physname
+ initializer.
+ (auto_language_data): Likewise.
+ * language.h (language_data): Delete la_class_name_from_physname
+ field.
+ (language_defn::class_name_from_physname): New function.
+ (language_class_name_from_physname): Delete declaration.
+ * m2-lang.c (m2_language_data): Delete la_class_name_from_physname
+ 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.
+
2020-06-16 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (STATUS_NAME): New macro.
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
ada_lookup_symbol_nonlocal, /* Looking up non-local symbols. */
- NULL, /* Language specific
- class_name_from_physname */
ada_op_print_tab, /* expression operators for printing */
0, /* c-style arrays */
1, /* String lower bound */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
"this", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- cp_class_name_from_physname, /* Language specific
- class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
{
return cplus_skip_trampoline (fi, pc);
}
+
+ /* See language.h. */
+
+ char *class_name_from_physname (const char *physname) const override
+ {
+ return cp_class_name_from_physname (physname);
+ }
};
/* The single instance of the C++ language class. */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
"this",
false, /* la_store_sym_names_in_linkage_form_p */
d_lookup_symbol_nonlocal,
- NULL, /* Language specific
- class_name_from_physname. */
d_op_print_tab, /* Expression operators for printing. */
1, /* C-style arrays. */
0, /* String lower bound. */
&& child_pdi->linkage_name != NULL)
{
gdb::unique_xmalloc_ptr<char> actual_class_name
- (language_class_name_from_physname (cu->language_defn,
- child_pdi->linkage_name));
+ (cu->language_defn->class_name_from_physname
+ (child_pdi->linkage_name));
if (actual_class_name != NULL)
{
struct objfile *objfile = cu->per_objfile->objfile;
if (linkage_name != NULL)
{
gdb::unique_xmalloc_ptr<char> actual_name
- (language_class_name_from_physname (cu->language_defn,
- linkage_name));
+ (cu->language_defn->class_name_from_physname (linkage_name));
const char *name = NULL;
if (actual_name != NULL)
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
f_op_print_tab, /* expression operators for printing */
0, /* arrays are first-class (not c-style) */
1, /* String lower bound */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal,
- NULL, /* Language specific
- class_name_from_physname. */
go_op_print_tab, /* Expression operators for printing. */
1, /* C-style arrays. */
0, /* String lower bound. */
return NULL;
}
-/* Return class name from physname or NULL. */
-char *
-language_class_name_from_physname (const struct language_defn *lang,
- const char *physname)
-{
- if (lang != NULL && lang->la_class_name_from_physname)
- return lang->la_class_name_from_physname (physname);
- return NULL;
-}
-
/* Return information about whether TYPE should be passed
(and returned) by reference at the language level. */
"function unk_lang_value_print called."));
}
-static char *unk_lang_class_name (const char *mangled)
-{
- return NULL;
-}
-
static const struct op_print unk_op_print_tab[] =
{
{NULL, OP_NULL, PREC_NULL, 0}
"this", /* name_of_this */
true, /* store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- unk_lang_class_name, /* Language specific
- class_name_from_physname */
unk_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
"this", /* name_of_this */
false, /* store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- unk_lang_class_name, /* Language specific
- class_name_from_physname */
unk_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
const struct block *,
const domain_enum);
- /* Return class name of a mangled method name or NULL. */
- char *(*la_class_name_from_physname) (const char *physname);
-
/* Table for printing expressions. */
const struct op_print *la_op_print_tab;
return (CORE_ADDR) 0;
}
+ /* Return class name of a mangled method name or NULL. */
+ virtual char *class_name_from_physname (const char *physname) const
+ {
+ return nullptr;
+ }
+
/* List of all known languages. */
static const struct language_defn *languages[nr_languages];
};
extern char *language_demangle (const struct language_defn *current_language,
const char *mangled, int options);
-/* Return class name from physname, or NULL. */
-extern char *language_class_name_from_physname (const struct language_defn *,
- const char *physname);
-
/* Splitting strings into words. */
extern const char *default_word_break_characters (void);
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
m2_op_print_tab, /* expression operators for printing */
0, /* arrays are first-class (not c-style) */
0, /* String lower bound */
"self", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
objc_op_print_tab, /* Expression operators for printing */
1, /* C-style arrays */
0, /* String lower bound */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
"this", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific class_name_from_physname */
pascal_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- NULL, /* Language specific
- class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */