+ int i, len;
+
+ len = TYPE_NFIELDS (type);
+
+ for (i = 0; i < len; i += 1)
+ {
+ if (ada_is_ignored_field (type, i))
+ continue;
+
+ if (ada_is_wrapper_field (type, i))
+ {
+ comma_needed =
+ print_field_values (TYPE_FIELD_TYPE (type, i),
+ valaddr,
+ (offset
+ + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT),
+ stream, recurse, val, options,
+ comma_needed, type, offset, language);
+ continue;
+ }
+ else if (ada_is_variant_part (type, i))
+ {
+ comma_needed =
+ print_variant_part (type, i, valaddr,
+ offset, stream, recurse, val,
+ options, comma_needed,
+ outer_type, outer_offset, language);
+ continue;
+ }
+
+ if (comma_needed)
+ fprintf_filtered (stream, ", ");
+ comma_needed = 1;
+
+ if (options->prettyformat)
+ {
+ fprintf_filtered (stream, "\n");
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
+ else
+ {
+ wrap_here (n_spaces (2 + 2 * recurse));
+ }
+
+ annotate_field_begin (TYPE_FIELD_TYPE (type, i));
+ fprintf_filtered (stream, "%.*s",
+ ada_name_prefix_len (TYPE_FIELD_NAME (type, i)),
+ TYPE_FIELD_NAME (type, i));
+ annotate_field_name_end ();
+ fputs_filtered (" => ", stream);
+ annotate_field_value ();
+
+ if (TYPE_FIELD_PACKED (type, i))
+ {
+ /* Bitfields require special handling, especially due to byte
+ order problems. */
+ if (HAVE_CPLUS_STRUCT (type) && TYPE_FIELD_IGNORE (type, i))
+ {
+ fputs_filtered (_("<optimized out or zero length>"), stream);
+ }
+ else
+ {
+ struct value *v;
+ int bit_pos = TYPE_FIELD_BITPOS (type, i);
+ int bit_size = TYPE_FIELD_BITSIZE (type, i);
+ struct value_print_options opts;
+
+ adjust_type_signedness (TYPE_FIELD_TYPE (type, i));
+ v = ada_value_primitive_packed_val
+ (NULL, valaddr,
+ offset + bit_pos / HOST_CHAR_BIT,
+ bit_pos % HOST_CHAR_BIT,
+ bit_size, TYPE_FIELD_TYPE (type, i));
+ opts = *options;
+ opts.deref_ref = 0;
+ val_print (TYPE_FIELD_TYPE (type, i),
+ value_embedded_offset (v), 0,
+ stream, recurse + 1, v,
+ &opts, language);
+ }
+ }
+ else
+ {
+ struct value_print_options opts = *options;
+
+ opts.deref_ref = 0;
+ val_print (TYPE_FIELD_TYPE (type, i),
+ (offset + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT),
+ 0, stream, recurse + 1, val, &opts, language);
+ }
+ annotate_field_end ();
+ }
+
+ return comma_needed;