diff options
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r-- | gdb/ada-valprint.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 9647971..3da58ea 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -269,7 +269,8 @@ printable_val_type (struct type *type, const gdb_byte *valaddr) (1 or 2) of the character. */ void -ada_emit_char (int c, struct ui_file *stream, int quoter, int type_len) +ada_emit_char (int c, struct type *type, struct ui_file *stream, + int quoter, int type_len) { if (type_len != 2) type_len = 1; @@ -366,10 +367,10 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type, } void -ada_printchar (int c, struct ui_file *stream) +ada_printchar (int c, struct type *type, struct ui_file *stream) { fputs_filtered ("'", stream); - ada_emit_char (c, stream, '\'', 1); + ada_emit_char (c, type, stream, '\'', 1); fputs_filtered ("'", stream); } @@ -411,7 +412,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) break; case TYPE_CODE_CHAR: - LA_PRINT_CHAR ((unsigned char) val, stream); + LA_PRINT_CHAR ((unsigned char) val, type, stream); break; case TYPE_CODE_BOOL: @@ -454,7 +455,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) */ static void -printstr (struct ui_file *stream, const gdb_byte *string, +printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, unsigned int length, int force_ellipses, int type_len, const struct value_print_options *options) { @@ -506,7 +507,7 @@ printstr (struct ui_file *stream, const gdb_byte *string, in_quotes = 0; } fputs_filtered ("'", stream); - ada_emit_char (char_at (string, i, type_len), stream, '\'', + ada_emit_char (char_at (string, i, type_len), elttype, stream, '\'', type_len); fputs_filtered ("'", stream); fprintf_filtered (stream, _(" <repeats %u times>"), reps); @@ -524,7 +525,7 @@ printstr (struct ui_file *stream, const gdb_byte *string, fputs_filtered ("\"", stream); in_quotes = 1; } - ada_emit_char (char_at (string, i, type_len), stream, '"', + ada_emit_char (char_at (string, i, type_len), elttype, stream, '"', type_len); things_printed += 1; } @@ -544,11 +545,12 @@ printstr (struct ui_file *stream, const gdb_byte *string, } void -ada_printstr (struct ui_file *stream, const gdb_byte *string, - unsigned int length, int width, int force_ellipses, +ada_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, + unsigned int length, int force_ellipses, const struct value_print_options *options) { - printstr (stream, string, length, force_ellipses, width, options); + printstr (stream, type, string, length, force_ellipses, TYPE_LENGTH (type), + options); } @@ -637,7 +639,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, len = temp_len; } - printstr (stream, valaddr, len, 0, eltlen, options); + printstr (stream, elttype, valaddr, len, 0, eltlen, options); result = len; } else @@ -817,7 +819,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0, { fputs_filtered (" ", stream); ada_printchar ((unsigned char) unpack_long (type, valaddr), - stream); + type, stream); } } return 0; |