case TYPE_CODE_PTR:
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
{
- fprintf_filtered (stream, "PTR");
+ fprintf_filtered (stream,
+ TYPE_NAME (type) ? TYPE_NAME (type) : "PTR");
break;
}
fprintf_filtered (stream, "REF ");
anyone ever fixes the compiler to give us the real names
in the presence of the chill equivalent of typedef (assuming
there is one). */
- fprintf_filtered (stream, "BOOL");
+ fprintf_filtered (stream,
+ TYPE_NAME (type) ? TYPE_NAME (type) : "BOOL");
break;
case TYPE_CODE_ARRAY:
enum val_prettyprint, struct type **));
\f
+/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
+ Used to print data from type structures in a specified type. For example,
+ array bounds may be characters or booleans in some languages, and this
+ allows the ranges to be printed in their "natural" form rather than as
+ decimal integer values. */
+
+void
+chill_print_type_scalar (type, val, stream)
+ struct type *type;
+ LONGEST val;
+ GDB_FILE *stream;
+{
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_RANGE:
+ if (TYPE_TARGET_TYPE (type))
+ {
+ chill_print_type_scalar (TYPE_TARGET_TYPE (type), val, stream);
+ return;
+ }
+ }
+ print_type_scalar (type, val, stream);
+}
+\f
/* Print the elements of an array.
Similar to val_print_array_elements, but prints
element indexes (in Chill syntax). */
}
fputs_filtered ("(", stream);
- print_type_scalar (index_type, low_bound + i, stream);
+ chill_print_type_scalar (index_type, low_bound + i, stream);
if (reps > 1)
{
fputs_filtered (":", stream);
- print_type_scalar (index_type, low_bound + i + reps - 1, stream);
+ chill_print_type_scalar (index_type, low_bound + i + reps - 1,
+ stream);
fputs_filtered ("): ", stream);
val_print (elttype, valaddr + i * eltlen, 0, stream, format,
deref_ref, recurse + 1, pretty);
{
if (need_comma)
fputs_filtered (", ", stream);
- print_type_scalar (range, i, stream);
+ chill_print_type_scalar (range, i, stream);
need_comma = 1;
/* Look for a continuous range of true elements. */
while (i+1 <= high_bound
&& value_bit_index (type, valaddr, ++i))
j = i;
- print_type_scalar (range, j, stream);
+ chill_print_type_scalar (range, j, stream);
}
}
}