gdb: change duplicate test name in gdb.base/jit-so.exp
[deliverable/binutils-gdb.git] / gdb / ada-valprint.c
index 59ada24b947461f17ca37c58cd4a4957dce3b3f1..010446d70f818a7d83511591e2468029d0ed8a82 100644 (file)
@@ -195,6 +195,11 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
              fprintf_filtered (stream, ", ");
            }
        }
+      else if (options->prettyformat_arrays)
+       {
+         fprintf_filtered (stream, "\n");
+         print_spaces_filtered (2 + 2 * recurse, stream);
+       }
       wrap_here (n_spaces (2 + 2 * recurse));
       maybe_print_array_index (index_type, i + low, stream, options);
 
@@ -560,14 +565,13 @@ print_variant_part (struct value *value, int field_num,
 {
   struct type *type = value_type (value);
   struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
-  int which = ada_which_variant_applies (var_type,
-                                        value_type (outer_value),
-                                        value_contents (outer_value));
+  int which = ada_which_variant_applies (var_type, outer_value);
 
   if (which < 0)
     return 0;
 
-  struct value *active_component = value_field (value, which);
+  struct value *variant_field = value_field (value, field_num);
+  struct value *active_component = value_field (variant_field, which);
   return print_field_values (active_component, outer_value, stream, recurse,
                             options, comma_needed, language);
 }
@@ -605,8 +609,10 @@ print_field_values (struct value *value, struct value *outer_value,
 
       if (ada_is_wrapper_field (type, i))
        {
+         struct value *field_val = ada_value_primitive_field (value, 0,
+                                                              i, type);
          comma_needed =
-           print_field_values (value_field (value, i), outer_value,
+           print_field_values (field_val, field_val,
                                stream, recurse, options,
                                comma_needed, language);
          continue;
@@ -707,9 +713,6 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr,
   eltlen = TYPE_LENGTH (elttype);
   len = TYPE_LENGTH (type) / eltlen;
 
-  if (options->prettyformat_arrays)
-    print_spaces_filtered (2 + 2 * recurse, stream);
-
   /* If requested, look for the first null char and only print
      elements up to it.  */
   if (options->stop_print_at_null)
@@ -1057,7 +1060,9 @@ ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
 
   const gdb_byte *valaddr = value_contents_for_printing (val);
   CORE_ADDR address = value_address (val);
-  type = ada_check_typedef (resolve_dynamic_type (type, valaddr, address));
+  gdb::array_view<const gdb_byte> view
+    = gdb::make_array_view (valaddr, TYPE_LENGTH (type));
+  type = ada_check_typedef (resolve_dynamic_type (type, view, address));
   if (type != saved_type)
     {
       val = value_copy (val);
This page took 0.025507 seconds and 4 git commands to generate.