From 5c6ce71d76dc5618b6ebfc967e5c4b99d701ef50 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 27 Sep 2008 21:29:30 +0000 Subject: gdb * scm-lang.c (scm_language_defn): Update. * p-typeprint.c (pascal_print_typedef): New function. * p-lang.h: (pascal_print_typedef): Declare. * p-lang.c (pascal_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * m2-typeprint.c (m2_print_typedef): New function. * m2-lang.h (m2_print_typedef): Declare. * m2-lang.c (m2_language_defn): Update. * language.h (_LANG_c, _LANG_m2, _LANG_fortran, _LANG_pascal): Remove. (struct language_defn) : New field. (default_print_typedef): Declare. (LA_PRINT_TYPEDEF): New define. * language.c (unknown_language_defn): Update. (auto_language_defn): Update. (local_language_defn): Update. * jv-lang.c (java_language_defn): Update. * f-lang.c (f_language_defn): Update. * c-typeprint.c (c_print_typedef): New function. * c-lang.h (c_print_typedef): Declare. * c-lang.c (c_language_defn): Update. (cplus_language_defn): Update. (asm_language_defn): Update. (minimal_language_defn): Update. * ada-lang.c (ada_language_defn): Update. * typeprint.c (default_print_typedef): New function. gdb/doc * gdbint.texinfo (Language Support): Remove text about omitting support for a language. --- gdb/m2-typeprint.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gdb/m2-typeprint.c') diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 666ae28..e2970e2 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -154,6 +154,26 @@ m2_print_type (struct type *type, char *varstring, struct ui_file *stream, } } +/* Print a typedef using M2 syntax. TYPE is the underlying type. + NEW_SYMBOL is the symbol naming the type. STREAM is the stream on + which to print. */ + +void +m2_print_typedef (struct type *type, struct symbol *new_symbol, + struct ui_file *stream) +{ + CHECK_TYPEDEF (type); + fprintf_filtered (stream, "TYPE "); + if (!TYPE_NAME (SYMBOL_TYPE (new_symbol)) + || strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))), + SYMBOL_LINKAGE_NAME (new_symbol)) != 0) + fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol)); + else + fprintf_filtered (stream, " = "); + type_print (type, "", stream, 0); + fprintf_filtered (stream, ";\n"); +} + /* m2_type_name - if a, type, has a name then print it. */ void -- cgit v1.1