- if (get_array_bounds (type, &low_bound, &high_bound))
- {
- len = high_bound - low_bound + 1;
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
- eltlen = TYPE_LENGTH (elttype);
- if (options->prettyformat_arrays)
- {
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- /* If 's' format is used, try to print out as string.
- If no format is given, print as string if element type
- is of TYPE_CODE_CHAR and element size is 1,2 or 4. */
- if (options->format == 's'
- || ((eltlen == 1 || eltlen == 2 || eltlen == 4)
- && TYPE_CODE (elttype) == TYPE_CODE_CHAR
- && options->format == 0))
- {
- /* If requested, look for the first null char and only print
- elements up to it. */
- if (options->stop_print_at_null)
- {
- unsigned int temp_len;
-
- /* Look for a NULL char. */
- for (temp_len = 0;
- extract_unsigned_integer (valaddr + embedded_offset +
- temp_len * eltlen, eltlen,
- byte_order)
- && temp_len < len && temp_len < options->print_max;
- temp_len++);
- len = temp_len;
- }
-
- LA_PRINT_STRING (stream, TYPE_TARGET_TYPE (type),
- valaddr + embedded_offset, len, NULL, 0,
- options);
- i = len;
- }
- else
- {
- fprintf_filtered (stream, "{");
- /* If this is a virtual function table, print the 0th
- entry specially, and the rest of the members normally. */
- if (pascal_object_is_vtbl_ptr_type (elttype))
- {
- i = 1;
- fprintf_filtered (stream, "%d vtable entries", len - 1);
- }
- else
- {
- i = 0;
- }
- val_print_array_elements (type, valaddr, embedded_offset,
- address, stream, recurse,
- original_value, options, i);
- fprintf_filtered (stream, "}");
- }
- break;
- }
- /* Array of unspecified length: treat like pointer to first elt. */
- addr = address + embedded_offset;
+ {
+ LONGEST low_bound, high_bound;
+
+ if (get_array_bounds (type, &low_bound, &high_bound))
+ {
+ len = high_bound - low_bound + 1;
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ eltlen = TYPE_LENGTH (elttype);
+ if (options->prettyformat_arrays)
+ {
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
+ /* If 's' format is used, try to print out as string.
+ If no format is given, print as string if element type
+ is of TYPE_CODE_CHAR and element size is 1,2 or 4. */
+ if (options->format == 's'
+ || ((eltlen == 1 || eltlen == 2 || eltlen == 4)
+ && TYPE_CODE (elttype) == TYPE_CODE_CHAR
+ && options->format == 0))
+ {
+ /* If requested, look for the first null char and only print
+ elements up to it. */
+ if (options->stop_print_at_null)
+ {
+ unsigned int temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+ extract_unsigned_integer (valaddr + embedded_offset +
+ temp_len * eltlen, eltlen,
+ byte_order)
+ && temp_len < len && temp_len < options->print_max;
+ temp_len++);
+ len = temp_len;
+ }
+
+ LA_PRINT_STRING (stream, TYPE_TARGET_TYPE (type),
+ valaddr + embedded_offset, len, NULL, 0,
+ options);
+ i = len;
+ }
+ else
+ {
+ fprintf_filtered (stream, "{");
+ /* If this is a virtual function table, print the 0th
+ entry specially, and the rest of the members normally. */
+ if (pascal_object_is_vtbl_ptr_type (elttype))
+ {
+ i = 1;
+ fprintf_filtered (stream, "%d vtable entries", len - 1);
+ }
+ else
+ {
+ i = 0;
+ }
+ val_print_array_elements (type, embedded_offset,
+ address, stream, recurse,
+ original_value, options, i);
+ fprintf_filtered (stream, "}");
+ }
+ break;
+ }
+ /* Array of unspecified length: treat like pointer to first elt. */
+ addr = address + embedded_offset;
+ }