/* Objective-C language support routines for GDB, the GNU debugger.
- Copyright (C) 2002-2019 Free Software Foundation, Inc.
+ Copyright (C) 2002-2020 Free Software Foundation, Inc.
Contributed by Apple Computer, Inc.
Written by Michael Snyder.
else
error (_("No struct type named %s."), name);
}
- if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
+ if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_STRUCT)
{
if (noerr)
return 0;
".m", NULL
};
-extern const struct language_defn objc_language_defn = {
+/* Constant data representing the Objective-C language. */
+
+extern const struct language_data objc_language_data =
+{
"objective-c", /* Language name */
"Objective-C",
language_objc,
c_emit_char,
c_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
- c_val_print, /* Print a value using appropriate syntax */
+ c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- default_read_var_value, /* la_read_var_value */
objc_skip_trampoline, /* Language specific skip_trampoline */
"self", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
- basic_lookup_transparent_type,/* lookup_transparent_type */
objc_demangle, /* Language specific symbol demangler */
objc_sniff_from_mangled_name,
NULL, /* Language specific
0, /* String lower bound */
default_word_break_characters,
default_collect_symbol_completion_matches,
- c_language_arch_info,
- default_print_array_index,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
- iterate_over_symbols,
default_search_name_hash,
&default_varobj_ops,
NULL,
- NULL,
c_is_string_type_p,
"{...}" /* la_struct_too_deep_ellipsis */
};
+/* Class representing the Objective-C language. */
+
+class objc_language : public language_defn
+{
+public:
+ objc_language ()
+ : language_defn (language_objc, objc_language_data)
+ { /* Nothing. */ }
+
+ /* See language.h. */
+ void language_arch_info (struct gdbarch *gdbarch,
+ struct language_arch_info *lai) const override
+ {
+ c_language_arch_info (gdbarch, lai);
+ }
+};
+
+/* Single instance of the class representing the Objective-C language. */
+
+static objc_language objc_language_defn;
+
/*
* ObjC:
* Following functions help construct Objective-C message calls.
return 0;
}
+void _initialize_objc_language ();
void
-_initialize_objc_language (void)
+_initialize_objc_language ()
{
add_info ("selectors", info_selectors_command,
_("All Objective-C selectors, or those matching REGEXP."));