* 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.
This commit is contained in:
Per Bothner
1993-12-21 22:18:51 +00:00
parent 0c3cab7aac
commit cba009211a
9 changed files with 189 additions and 55 deletions

View File

@@ -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), "<var_length>") != 0)
return 0;
return 1;
}
static struct type *
chill_create_fundamental_type (objfile, typeid)
struct objfile *objfile;