- fprintf_filtered (stream, "@");
- fputs_filtered (paddress (gdbarch, addr), stream);
- if (options->deref_ref)
- fputs_filtered (": ", stream);
- }
- /* De-reference the reference. */
- if (options->deref_ref)
+static void
+c_value_print_array (struct value *val,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
+{
+ struct type *type = check_typedef (value_type (val));
+ CORE_ADDR address = value_address (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val);
+ struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
+ struct type *elttype = check_typedef (unresolved_elttype);
+
+ if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
+ {
+ LONGEST low_bound, high_bound;
+ int eltlen, len;
+ enum bfd_endian byte_order = type_byte_order (type);
+
+ if (!get_array_bounds (type, &low_bound, &high_bound))
+ error (_("Could not determine the array high bound"));
+
+ eltlen = TYPE_LENGTH (elttype);
+ len = high_bound - low_bound + 1;
+
+ /* Print arrays of textual chars with a string syntax, as
+ long as the entire array is valid. */
+ if (c_textual_element_type (unresolved_elttype,
+ options->format)
+ && value_bytes_available (val, 0, TYPE_LENGTH (type))
+ && !value_bits_any_optimized_out (val, 0,
+ TARGET_CHAR_BIT * TYPE_LENGTH (type)))