/* Pascal language support routines for GDB, the GNU debugger.
- Copyright (C) 2000-2021 Free Software Foundation, Inc.
+ Copyright (C) 2000-2022 Free Software Foundation, Inc.
This file is part of GDB.
/* Old Borland type pascal strings from Free Pascal Compiler. */
/* Two fields: length and st. */
if (type->num_fields () == 2
- && TYPE_FIELD_NAME (type, 0)
- && strcmp (TYPE_FIELD_NAME (type, 0), "length") == 0
- && TYPE_FIELD_NAME (type, 1)
- && strcmp (TYPE_FIELD_NAME (type, 1), "st") == 0)
+ && type->field (0).name ()
+ && strcmp (type->field (0).name (), "length") == 0
+ && type->field (1).name ()
+ && strcmp (type->field (1).name (), "st") == 0)
{
if (length_pos)
- *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
+ *length_pos = type->field (0).loc_bitpos () / TARGET_CHAR_BIT;
if (length_size)
*length_size = TYPE_LENGTH (type->field (0).type ());
if (string_pos)
- *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ *string_pos = type->field (1).loc_bitpos () / TARGET_CHAR_BIT;
if (char_type)
*char_type = TYPE_TARGET_TYPE (type->field (1).type ());
if (arrayname)
- *arrayname = TYPE_FIELD_NAME (type, 1);
+ *arrayname = type->field (1).name ();
return 2;
};
/* GNU pascal strings. */
/* Three fields: Capacity, length and schema$ or _p_schema. */
if (type->num_fields () == 3
- && TYPE_FIELD_NAME (type, 0)
- && strcmp (TYPE_FIELD_NAME (type, 0), "Capacity") == 0
- && TYPE_FIELD_NAME (type, 1)
- && strcmp (TYPE_FIELD_NAME (type, 1), "length") == 0)
+ && type->field (0).name ()
+ && strcmp (type->field (0).name (), "Capacity") == 0
+ && type->field (1).name ()
+ && strcmp (type->field (1).name (), "length") == 0)
{
if (length_pos)
- *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ *length_pos = type->field (1).loc_bitpos () / TARGET_CHAR_BIT;
if (length_size)
*length_size = TYPE_LENGTH (type->field (1).type ());
if (string_pos)
- *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
+ *string_pos = type->field (2).loc_bitpos () / TARGET_CHAR_BIT;
/* FIXME: how can I detect wide chars in GPC ?? */
if (char_type)
{
*char_type = TYPE_TARGET_TYPE (*char_type);
}
if (arrayname)
- *arrayname = TYPE_FIELD_NAME (type, 2);
+ *arrayname = type->field (2).name ();
return 3;
};
}
if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c))))
{
if (!(*in_quotes))
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
*in_quotes = 1;
if (c == '\'')
{
- fputs_filtered ("''", stream);
+ gdb_puts ("''", stream);
}
else
- fprintf_filtered (stream, "%c", c);
+ gdb_printf (stream, "%c", c);
}
else
{
if (*in_quotes)
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
*in_quotes = 0;
- fprintf_filtered (stream, "#%d", (unsigned int) c);
+ gdb_printf (stream, "#%d", (unsigned int) c);
}
}
print_one_char (c, stream, &in_quotes);
if (in_quotes)
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
}
\f
if (length == 0)
{
- fputs_filtered ("''", stream);
+ gdb_puts ("''", stream);
return;
}
if (need_comma)
{
- fputs_filtered (", ", stream);
+ gdb_puts (", ", stream);
need_comma = 0;
}
{
if (in_quotes)
{
- fputs_filtered ("', ", stream);
+ gdb_puts ("', ", stream);
in_quotes = 0;
}
printchar (current_char, elttype, stream);
- fprintf_filtered (stream, " %p[<repeats %u times>%p]",
- metadata_style.style ().ptr (),
- reps, nullptr);
+ gdb_printf (stream, " %p[<repeats %u times>%p]",
+ metadata_style.style ().ptr (),
+ reps, nullptr);
i = rep1 - 1;
things_printed += options->repeat_count_threshold;
need_comma = 1;
{
if ((!in_quotes) && (PRINT_LITERAL_FORM (current_char)))
{
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
in_quotes = 1;
}
print_one_char (current_char, stream, &in_quotes);
/* Terminate the quotes if necessary. */
if (in_quotes)
- fputs_filtered ("'", stream);
+ gdb_puts ("'", stream);
if (force_ellipses || i < length)
- fputs_filtered ("...", stream);
+ gdb_puts ("...", stream);
}
/* Single instance of the Pascal language class. */