gdb: Convert language la_lookup_symbol_nonlocal field to a method
[deliverable/binutils-gdb.git] / gdb / p-lang.c
index 50b913e8b6c12900cc7360646b3bd1ef81013e4b..5c1b273e7f5260718b49347a6925dcc2f0e185b3 100644 (file)
@@ -113,11 +113,11 @@ is_pascal_string_type (struct type *type,int *length_pos,
           if (length_pos)
            *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
           if (length_size)
-           *length_size = TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0));
+           *length_size = TYPE_LENGTH (type->field (0).type ());
           if (string_pos)
            *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
           if (char_type)
-           *char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 1));
+           *char_type = TYPE_TARGET_TYPE (type->field (1).type ());
          if (arrayname)
            *arrayname = TYPE_FIELD_NAME (type, 1);
          return 2;
@@ -133,13 +133,13 @@ is_pascal_string_type (struct type *type,int *length_pos,
          if (length_pos)
            *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
          if (length_size)
-           *length_size = TYPE_LENGTH (TYPE_FIELD_TYPE (type, 1));
+           *length_size = TYPE_LENGTH (type->field (1).type ());
          if (string_pos)
            *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
           /* FIXME: how can I detect wide chars in GPC ??  */
           if (char_type)
            {
-             *char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 2));
+             *char_type = TYPE_TARGET_TYPE (type->field (2).type ());
 
              if ((*char_type)->code () == TYPE_CODE_ARRAY)
                *char_type = TYPE_TARGET_TYPE (*char_type);
@@ -399,22 +399,12 @@ extern const struct language_data pascal_language_data =
   pascal_printstr,             /* Function to print string constant */
   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 */
-  NULL,                                /* Language specific skip_trampoline */
   "this",                      /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
-  basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
-  NULL,                                /* Language specific class_name_from_physname */
   pascal_op_print_tab,         /* expression operators for printing */
   1,                           /* c-style arrays */
   0,                           /* String lower bound */
-  default_word_break_characters,
-  default_collect_symbol_completion_matches,
-  c_watch_location_expression,
-  NULL,                                /* la_compare_symbol_for_completion */
   &default_varobj_ops,
-  NULL,
   pascal_is_string_type_p,
   "{...}"                      /* la_struct_too_deep_ellipsis */
 };
@@ -485,6 +475,23 @@ public:
   {
     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);
+  }
+
+  /* See language.h.  */
+
+  void value_print_inner
+       (struct value *val, struct ui_file *stream, int recurse,
+        const struct value_print_options *options) const override
+  {
+    return pascal_value_print_inner (val, stream, recurse, options);
+  }
 };
 
 /* Single instance of the Pascal language class.  */
This page took 0.025174 seconds and 4 git commands to generate.