+2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Delete la_value_print
+ initializer.
+ (ada_language::value_print): New member function.
+ * c-lang.c (c_language_data): Delete la_value_print initializer.
+ (cplus_language_data): Likewise.
+ (asm_language_data): Likewise.
+ (minimal_language_data): Likewise.
+ * d-lang.c (d_language_data): Likewise.
+ * f-lang.c (f_language_data): Likewise.
+ * go-lang.c (go_language_data): Likewise.
+ * language.c (unk_lang_value_print): Delete.
+ (language_defn::value_print): Define new member function.
+ (unknown_language_data): Delete la_value_print initializer.
+ (unknown_language::value_print): New member function.
+ (auto_language_data): Delete la_value_print initializer.
+ (auto_language::value_print): New member function.
+ * language.h (language_data): Delete la_value_print field.
+ (language_defn::value_print): Declare new member function.
+ (LA_VALUE_PRINT): Update call to value_print.
+ * m2-lang.c (m2_language_data): Delete la_value_print initializer.
+ * objc-lang.c (objc_language_data): Likewise.
+ * opencl-lang.c (opencl_language_data): Likewise.
+ * p-lang.c (pascal_language_data): Likewise.
+ (pascal_language::value_print): New member function.
+ * rust-lang.c (rust_language_data): Delete la_value_print
+ initializer.
+
2020-06-17 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_watch_location_expression): Rename to
emit_char, /* Function to print single char (not used) */
ada_print_typedef, /* Print a typedef using appropriate syntax */
ada_value_print_inner, /* la_value_print_inner */
- ada_value_print, /* Print a top-level value */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
ada_lookup_symbol_nonlocal, /* Looking up non-local symbols. */
(xstrprintf ("{%s} %s", name.c_str (), core_addr_to_string (addr)));
}
+ /* See language.h. */
+
+ void value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options) const override
+ {
+ return ada_value_print (val, stream, options);
+ }
+
protected:
/* See language.h. */
c_emit_char, /* Print a single char */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_emit_char, /* Print a single char */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
"this", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_emit_char, /* Print a single char */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_emit_char, /* Print a single char */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_print_typedef, /* Print a typedef using appropriate
syntax. */
d_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value. */
"this",
false, /* la_store_sym_names_in_linkage_form_p */
d_lookup_symbol_nonlocal,
f_emit_char, /* Function to print a single character */
f_print_typedef, /* Print a typedef using appropriate syntax */
f_value_print_innner, /* la_value_print_inner */
- c_value_print, /* FIXME */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_print_typedef, /* Print a typedef using appropriate
syntax. */
go_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value. */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal,
static void unk_lang_printchar (int c, struct type *type,
struct ui_file *stream);
-static void unk_lang_value_print (struct value *, struct ui_file *,
- const struct value_print_options *);
-
/* The current (default at startup) state of type and range checking.
(If the modes are set to "auto", though, these are changed based
on the default language at startup, and then again based on the
(xstrprintf ("* (%s *) %s", name.c_str (), core_addr_to_string (addr)));
}
+/* See language.h. */
+
+void
+language_defn::value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options) const
+{
+ return c_value_print (val, stream, options);
+}
+
/* The default implementation of the get_symbol_name_matcher_inner method
from the language_defn class. Matches with strncmp_iw. */
"function unk_lang_value_print_inner called."));
}
-static void
-unk_lang_value_print (struct value *val, struct ui_file *stream,
- const struct value_print_options *options)
-{
- error (_("internal error - unimplemented "
- "function unk_lang_value_print called."));
-}
-
static const struct op_print unk_op_print_tab[] =
{
{NULL, OP_NULL, PREC_NULL, 0}
unk_lang_emit_char,
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_value_print_inner, /* la_value_print_inner */
- unk_lang_value_print, /* Print a top-level value */
"this", /* name_of_this */
true, /* store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
/* The unknown language just uses the C++ demangler. */
return gdb_demangle (mangled, options);
}
+
+ /* See language.h. */
+
+ void value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options) const override
+ {
+ error (_("unimplemented unknown_language::value_print called"));
+ }
};
/* Single instance of the unknown language class. */
unk_lang_emit_char,
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_value_print_inner, /* la_value_print_inner */
- unk_lang_value_print, /* Print a top-level value */
"this", /* name_of_this */
false, /* store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
/* The auto language just uses the C++ demangler. */
return gdb_demangle (mangled, options);
}
+
+ /* See language.h. */
+
+ void value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options) const override
+ {
+ error (_("unimplemented auto_language::value_print called"));
+ }
};
/* Single instance of the fake "auto" language. */
int recurse,
const struct value_print_options *);
- /* Print a top-level value using syntax appropriate for this language. */
-
- void (*la_value_print) (struct value *, struct ui_file *,
- const struct value_print_options *);
-
/* Now come some hooks for lookup_symbol. */
/* If this is non-NULL, specifies the name that of the implicit
/* List of all known languages. */
static const struct language_defn *languages[nr_languages];
+ /* Print a top-level value using syntax appropriate for this language. */
+ virtual void value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options) const;
+
protected:
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
(current_language->la_print_typedef(type,new_symbol,stream))
#define LA_VALUE_PRINT(val,stream,options) \
- (current_language->la_value_print(val,stream,options))
+ (current_language->value_print (val,stream,options))
#define LA_PRINT_CHAR(ch, type, stream) \
(current_language->la_printchar(ch, type, stream))
m2_emit_char, /* Function to print a single character */
m2_print_typedef, /* Print a typedef using appropriate syntax */
m2_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_emit_char,
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
"self", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_emit_char, /* Print a single char */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
pascal_emit_char, /* Print a single char */
pascal_print_typedef, /* Print a typedef using appropriate syntax */
pascal_value_print_inner, /* la_value_print_inner */
- pascal_value_print, /* Print a top-level value */
"this", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
{
pascal_print_type (type, varstring, stream, show, level, flags);
}
+
+ /* See language.h. */
+
+ void value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options) const override
+ {
+ return pascal_value_print (val, stream, options);
+ }
};
/* Single instance of the Pascal language class. */
rust_emitchar, /* Print a single char */
rust_print_typedef, /* Print a typedef using appropriate syntax */
rust_value_print_inner, /* la_value_print_inner */
- c_value_print, /* Print a top-level value */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */