static void
chill_printchar (c, stream)
register int c;
- FILE *stream;
+ GDB_FILE *stream;
{
c &= 0xFF; /* Avoid sign bit follies */
static void
chill_printstr (stream, string, length, force_ellipses)
- FILE *stream;
+ GDB_FILE *stream;
char *string;
unsigned int length;
int force_ellipses;
if (length == 0)
{
- chill_printchar ('\0', stream);
+ fputs_filtered ("\"\"", stream);
return;
}
{
if (in_control_form || in_literal_form)
{
- fputs_filtered ("'//", stream);
+ fputs_filtered ("\"//", stream);
in_control_form = in_literal_form = 0;
}
chill_printchar (c, stream);
{
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);
{
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);
/* Terminate the quotes if necessary. */
if (in_literal_form || in_control_form)
{
- fputs_filtered ("'", stream);
+ fputs_filtered ("\"", stream);
}
if (force_ellipses || (i < length))
{
}
}
+/* 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;
type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
break;
case FT_SIGNED_CHAR:
- type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_SIGNED, "BYTE", objfile);
+ type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
break;
case FT_SHORT: /* Chill ints are 2 bytes */
- type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_SIGNED, "INT", objfile);
+ type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
break;
case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
break;
- case FT_INTEGER: /* Chill longs are 4 bytes */
- type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_SIGNED, "LONG", objfile);
+ case FT_INTEGER: /* FIXME? */
+ case FT_SIGNED_INTEGER: /* FIXME? */
+ case FT_LONG: /* Chill longs are 4 bytes */
+ case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
+ type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
break;
- case FT_UNSIGNED_INTEGER: /* Chill longs are 4 bytes */
+ case FT_UNSIGNED_INTEGER: /* FIXME? */
+ case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
break;
case FT_FLOAT:
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
{"/", BINOP_DIV, PREC_MUL, 0},
+ {"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
{"-", UNOP_NEG, PREC_PREFIX, 0},
{NULL, 0, 0, 0}
};
chill_create_fundamental_type,/* Create fundamental type in this language */
chill_print_type, /* Print a type using appropriate syntax */
chill_val_print, /* Print a value using appropriate syntax */
- &BUILTIN_TYPE_LONGEST, /* longest signed integral type */
- &BUILTIN_TYPE_UNSIGNED_LONGEST,/* longest unsigned integral type */
&builtin_type_chill_real, /* longest floating point type */
{"", "B'", "", ""}, /* Binary format info */
- {"O'%o", "O'", "o", ""}, /* Octal format info */
- {"D'%d", "D'", "d", ""}, /* Decimal format info */
- {"H'%x", "H'", "x", ""}, /* Hex format info */
+ {"O'%lo", "O'", "o", ""}, /* Octal format info */
+ {"D'%ld", "D'", "d", ""}, /* Decimal format info */
+ {"H'%lx", "H'", "x", ""}, /* Hex format info */
chill_op_print_tab, /* expression operators for printing */
LANG_MAGIC
};