From cba009211a9e13e8c773c30fb35dd8ef61477554 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Tue, 21 Dec 1993 22:18:51 +0000 Subject: * ch-exp.y (match_dollar_tokens): Fix off-by-one bug. * ch-lang.c (chill_is_varying_struct), ch-lang.h: New function. * ch-lang.c (chill_printstr): Use double quotes, not single quotes. * ch-typeprint.c (chill_type_print_base): Handle TYPE_CODE_BITSTRING. Improve printing of TYPE_CODE_STRING, TYPE_CODE_SET, and TYPE_CODE_STRUCT (including checking chill_is_varying_struct). Print TYPE_DUMMY_RANGE by printing its TYPE_TARGET_TYPE. Handle TYPE_CODE_ENUM. * ch-valprint.c (chill_val_print): Handle TYPE_CODE_BITSTRING. For TYPE_CODE_STRING, never print address. Handle VARYING strings. * gdbtypes.c (force_to_range_type): New. * gdbtypes.c (create_set_type): Make work, following Chill layout. * gdbtypes.h (TYPE_LOW_BOUND, TYPE_HIGH_BOUND, TYPE_DUMMY_RANGE): New. * stabsread.c (read_type): Distinguish string and bitstring from char-array and set. * valarith.c (value_subscript), valops.c (value_coerce_array): Handle STRINGs as well as ARRAYs. * valarith.c (value_bit_index): Fix think. Use new macros. --- gdb/ch-lang.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'gdb/ch-lang.c') diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c index 7fa063b..32ab878 100644 --- a/gdb/ch-lang.c +++ b/gdb/ch-lang.c @@ -128,7 +128,7 @@ chill_printstr (stream, string, length, force_ellipses) { if (in_control_form || in_literal_form) { - fputs_filtered ("'//", stream); + fputs_filtered ("\"//", stream); in_control_form = in_literal_form = 0; } chill_printchar (c, stream); @@ -145,10 +145,10 @@ chill_printstr (stream, string, length, force_ellipses) { if (in_control_form) { - fputs_filtered ("'//", stream); + fputs_filtered ("\"//", stream); in_control_form = 0; } - fputs_filtered ("'", stream); + fputs_filtered ("\"", stream); in_literal_form = 1; } fprintf_filtered (stream, "%c", c); @@ -159,10 +159,10 @@ chill_printstr (stream, string, length, force_ellipses) { if (in_literal_form) { - fputs_filtered ("'//", stream); + fputs_filtered ("\"//", stream); in_literal_form = 0; } - fputs_filtered ("c'", stream); + fputs_filtered ("c\"", stream); in_control_form = 1; } fprintf_filtered (stream, "%.2x", c); @@ -174,7 +174,7 @@ chill_printstr (stream, string, length, force_ellipses) /* Terminate the quotes if necessary. */ if (in_literal_form || in_control_form) { - fputs_filtered ("'", stream); + fputs_filtered ("\"", stream); } if (force_ellipses || (i < length)) { @@ -182,6 +182,21 @@ chill_printstr (stream, string, length, force_ellipses) } } +/* Return 1 if TYPE is a varying string or array. */ + +int +chill_is_varying_struct (type) + struct type *type; +{ + if (TYPE_CODE (type) != TYPE_CODE_STRUCT) + return 0; + if (TYPE_NFIELDS (type) != 2) + return 0; + if (strcmp (TYPE_FIELD_NAME (type, 0), "") != 0) + return 0; + return 1; +} + static struct type * chill_create_fundamental_type (objfile, typeid) struct objfile *objfile; -- cgit v1.1