/* Support for printing C and C++ types for GDB, the GNU debugger.
- Copyright (C) 1986-2020 Free Software Foundation, Inc.
+ Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.
fputs_styled (varstring, variable_name_style.style (), stream);
/* For demangled function names, we have the arglist as part of
- the name, so don't print an additional pair of ()'s. */
+ the name, so don't print an additional pair of ()'s. */
if (local_name == NULL)
{
demangled_args = strchr (varstring, '(') != NULL;
int show, int level,
const struct type_print_options *flags)
{
- struct print_offset_data podata;
+ struct print_offset_data podata (flags);
c_print_type_1 (type, varstring, stream, show, level,
current_language->la_language, flags, &podata);
enum language language,
const struct type_print_options *flags)
{
- struct print_offset_data podata;
+ struct print_offset_data podata (flags);
c_print_type_1 (type, varstring, stream, show, level, language, flags,
&podata);
case TYPE_CODE_COMPLEX:
case TYPE_CODE_NAMESPACE:
case TYPE_CODE_DECFLOAT:
+ case TYPE_CODE_FIXED_POINT:
/* These types need no prefix. They are listed here so that
- gcc -Wall will reveal any types that haven't been handled. */
+ gcc -Wall will reveal any types that haven't been handled. */
break;
default:
error (_("type not handled in c_type_print_varspec_prefix()"));
}
address_space_id
- = address_space_type_instance_flags_to_name (get_type_arch (type),
+ = address_space_type_instance_flags_to_name (type->arch (),
type->instance_flags ());
if (address_space_id)
{
case TYPE_CODE_COMPLEX:
case TYPE_CODE_NAMESPACE:
case TYPE_CODE_DECFLOAT:
+ case TYPE_CODE_FIXED_POINT:
/* These types do not need a suffix. They are listed so that
- gcc -Wall will report types that may not have been
- considered. */
+ gcc -Wall will report types that may not have been
+ considered. */
break;
default:
error (_("type not handled in c_type_print_varspec_suffix()"));
static bool
need_access_label_p (struct type *type)
{
- if (TYPE_DECLARED_CLASS (type))
+ if (type->is_declared_class ())
{
QUIT;
for (int i = TYPE_N_BASECLASSES (type); i < type->num_fields (); i++)
c_type_print_modifier (type, stream, 0, 1, language);
if (type->code () == TYPE_CODE_UNION)
fprintf_filtered (stream, "union ");
- else if (TYPE_DECLARED_CLASS (type))
+ else if (type->is_declared_class ())
fprintf_filtered (stream, "class ");
else
fprintf_filtered (stream, "struct ");
if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
{
+ print_spaces_filtered_with_print_options (level + 4, stream, flags);
if (type->is_stub ())
- fprintfi_filtered (level + 4, stream,
- _("%p[<incomplete type>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream, _("%p[<incomplete type>%p]\n"),
+ metadata_style.style ().ptr (), nullptr);
else
- fprintfi_filtered (level + 4, stream,
- _("%p[<no data fields>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream, _("%p[<no data fields>%p]\n"),
+ metadata_style.style ().ptr (), nullptr);
}
/* Start off with no specific section type, so we can print
int len = type->num_fields ();
vptr_fieldno = get_vptr_fieldno (type, &basetype);
- struct print_offset_data local_podata;
+ struct print_offset_data local_podata (flags);
for (int i = TYPE_N_BASECLASSES (type); i < len; i++)
{
print_spaces_filtered (2, stream);
}
- fprintfi_filtered (level, stream, "}");
+ fprintf_filtered (stream, "%*s}", level, "");
}
}
fprintf_filtered (stream, "union ");
else if (type->code () == TYPE_CODE_STRUCT)
{
- if (TYPE_DECLARED_CLASS (type))
+ if (type->is_declared_class ())
fprintf_filtered (stream, "class ");
else
fprintf_filtered (stream, "struct ");
case TYPE_CODE_ENUM:
c_type_print_modifier (type, stream, 0, 1, language);
fprintf_filtered (stream, "enum ");
- if (TYPE_DECLARED_CLASS (type))
+ if (type->is_declared_class ())
fprintf_filtered (stream, "class ");
/* Print the tag name if it exists.
- The aCC compiler emits a spurious
- "{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
- tag for unnamed struct/union/enum's, which we don't
- want to print. */
+ The aCC compiler emits a spurious
+ "{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
+ tag for unnamed struct/union/enum's, which we don't
+ want to print. */
if (type->name () != NULL
&& !startswith (type->name (), "{unnamed"))
{
if (type->num_fields () == 0)
{
if (type->is_stub ())
- fprintfi_filtered (level + 4, stream,
- _("%p[<incomplete type>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream,
+ _("%*s%p[<incomplete type>%p]\n"),
+ level + 4, "",
+ metadata_style.style ().ptr (), nullptr);
else
- fprintfi_filtered (level + 4, stream,
- _("%p[<no data fields>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ fprintf_filtered (stream,
+ _("%*s%p[<no data fields>%p]\n"),
+ level + 4, "",
+ metadata_style.style ().ptr (), nullptr);
}
len = type->num_fields ();
for (i = 0; i < len; i++)
}
fprintf_filtered (stream, ";\n");
}
- fprintfi_filtered (level, stream, "}");
+ fprintf_filtered (stream, "%*s}", level, "");
}
}
break;
fprintf_styled (stream, metadata_style.style (), _("<range type>"));
break;
+ case TYPE_CODE_FIXED_POINT:
+ print_type_fixed_point (type, stream);
+ break;
+
case TYPE_CODE_NAMESPACE:
fputs_filtered ("namespace ", stream);
fputs_filtered (type->name (), stream);
default:
/* Handle types not explicitly handled by the other cases, such
- as fundamental types. For these, just print whatever the
- type name is, as recorded in the type itself. If there is no
- type name, then complain. */
+ as fundamental types. For these, just print whatever the
+ type name is, as recorded in the type itself. If there is no
+ type name, then complain. */
if (type->name () != NULL)
{
c_type_print_modifier (type, stream, 0, 1, language);
int show, int level,
const struct type_print_options *flags)
{
- struct print_offset_data podata;
+ struct print_offset_data podata (flags);
c_type_print_base_1 (type, stream, show, level,
current_language->la_language, flags, &podata);