gdb: Convert language la_read_var_value field to a method
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index c277dc909476c7751cc31c7939e83b243a9a40f2..f6fd8f5e465f490eabe511f46c9d04defcf57f85 100644 (file)
@@ -95,7 +95,7 @@ lookup_struct_typedef (const char *name, const struct block *block, int noerr)
       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;
@@ -364,7 +364,10 @@ static const char *objc_extensions[] =
   ".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,
@@ -381,10 +384,8 @@ extern const struct language_defn objc_language_defn = {
   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 */
-  nullptr,                     /* la_value_print_inner */
+  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 */
@@ -400,7 +401,6 @@ extern const struct language_defn objc_language_defn = {
   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 */
@@ -413,6 +413,20 @@ extern const struct language_defn objc_language_defn = {
   "{...}"                      /* 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.  */ }
+};
+
+/* 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.
This page took 0.024369 seconds and 4 git commands to generate.