Change regcache list to be an hash map
[deliverable/binutils-gdb.git] / gdb / ada-valprint.c
index d295e55aec646f0c62d2fd1c4ceb91fbd00dee37..61893d5cad3fe2dbfcef0582101e51a03de8b911 100644 (file)
@@ -542,7 +542,7 @@ print_variant_part (struct value *value, int field_num,
                    const struct language_defn *language)
 {
   struct type *type = value_type (value);
-  struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
+  struct type *var_type = type->field (field_num).type ();
   int which = ada_which_variant_applies (var_type, outer_value);
 
   if (which < 0)
@@ -617,7 +617,7 @@ print_field_values (struct value *value, struct value *outer_value,
          wrap_here (n_spaces (2 + 2 * recurse));
        }
 
-      annotate_field_begin (TYPE_FIELD_TYPE (type, i));
+      annotate_field_begin (type->field (i).type ());
       fprintf_filtered (stream, "%.*s",
                        ada_name_prefix_len (TYPE_FIELD_NAME (type, i)),
                        TYPE_FIELD_NAME (type, i));
@@ -641,12 +641,12 @@ print_field_values (struct value *value, struct value *outer_value,
              int bit_size = TYPE_FIELD_BITSIZE (type, i);
              struct value_print_options opts;
 
-             adjust_type_signedness (TYPE_FIELD_TYPE (type, i));
+             adjust_type_signedness (type->field (i).type ());
              v = ada_value_primitive_packed_val
                    (value, nullptr,
                     bit_pos / HOST_CHAR_BIT,
                     bit_pos % HOST_CHAR_BIT,
-                    bit_size, TYPE_FIELD_TYPE (type, i));
+                    bit_size, type->field (i).type ());
              opts = *options;
              opts.deref_ref = 0;
              common_val_print (v, stream, recurse + 1, &opts, language);
@@ -754,10 +754,10 @@ ada_value_print_ptr (struct value *val,
   struct type *type = ada_check_typedef (value_type (val));
   if (ada_is_tag_type (type))
     {
-      const char *name = ada_tag_name (val);
+      gdb::unique_xmalloc_ptr<char> name = ada_tag_name (val);
 
       if (name != NULL)
-       fprintf_filtered (stream, " (%s)", name);
+       fprintf_filtered (stream, " (%s)", name.get ());
     }
 }
 
This page took 0.037749 seconds and 4 git commands to generate.