- /* Can't just call c_val_print because that print bytes as C chars. */
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ /* Can't just call c_val_print because that prints bytes as C
+ chars. */
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr, type, &opts, 0, stream);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_CHAR
+ || (TYPE_CODE (type) == TYPE_CODE_INT
+ && TYPE_LENGTH (type) == 2
+ && strcmp (TYPE_NAME (type), "char") == 0))
+ LA_PRINT_CHAR ((int) unpack_long (type, valaddr), type, stream);