aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-05-14 19:03:45 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-02 13:53:11 +0100
commit0a50df5dabfe12c8bf20f4f724622ff38ef7828b (patch)
tree94db36b29dc0e23875a6b604d07338a12962fe82 /gdb/language.h
parentfbfb0a463fc7de88a2da8858ac5cd6c2f4796514 (diff)
downloadgdb-0a50df5dabfe12c8bf20f4f724622ff38ef7828b.zip
gdb-0a50df5dabfe12c8bf20f4f724622ff38ef7828b.tar.gz
gdb-0a50df5dabfe12c8bf20f4f724622ff38ef7828b.tar.bz2
gdb: Convert language la_demangle field to a method
This commit changes the language_data::la_demangle function pointer member variable into a member function of language_defn. The only slightly "weird" change in this commit is in f-lang.c, where I have given the Fortran language a demangle method that is identical to the default language_defn::demangle. The only reason for this is to give me somewhere to copy the comment that was previously embedded within the f_language_data structure. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Delete la_demangle initializer. (ada_language::demangle): New member function. * c-lang.c (c_language_data): Delete la_demangle initializer. (cplus_language_data): Delete la_demangle initializer. (cplus_language::demangle): New member function. (asm_language_data): Delete la_demangle initializer. (minimal_language_data): Delete la_demangle initializer. * d-lang.c (d_language_data): Delete la_demangle initializer. (d_language::demangle): New member function. * f-lang.c (f_language_data): Delete la_demangle initializer. (f_language::demangle): New member function. * go-lang.c (go_language_data): Delete la_demangle initializer. (go_language::demangle): New member function. * language.c (language_demangle): Update. (unk_lang_demangle): Delete. (unknown_language_data): Delete la_demangle initializer. (unknown_language::demangle): New member function. (auto_language_data): Delete la_demangle initializer. (auto_language::demangle): New member function. * language.h (language_data): Delete la_demangle field. (language_defn::demangle): New function. * m2-lang.c (m2_language_data): Delete la_demangle initializer. * objc-lang.c (objc_language_data): Delete la_demangle initializer. (objc_language::demangle): New member function. * opencl-lang.c (opencl_language_data): Delete la_demangle initializer. * p-lang.c (pascal_language_data): Likewise. * rust-lang.c (rust_language_data): Likewise. (rust_language::demangle): New member functi
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/language.h b/gdb/language.h
index 8defe95..c456189 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -310,9 +310,6 @@ struct language_data
const struct block *,
const domain_enum);
- /* Return demangled language symbol, or NULL. */
- char *(*la_demangle) (const char *mangled, int options);
-
/* Return class name of a mangled method name or NULL. */
char *(*la_class_name_from_physname) (const char *physname);
@@ -512,6 +509,12 @@ struct language_defn : language_data
return false;
}
+ /* Return demangled language symbol version of MANGLED, or NULL. */
+ virtual char *demangle (const char *mangled, int options) const
+ {
+ return nullptr;
+ }
+
/* Print a type using syntax appropriate for this language. */
virtual void print_type (struct type *, const char *, struct ui_file *, int,