/* 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.
&& (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
|| code == TYPE_CODE_METHOD
|| (code == TYPE_CODE_ARRAY
- && !TYPE_VECTOR (type))
+ && !type->is_vector ())
|| code == TYPE_CODE_MEMBERPTR
|| code == TYPE_CODE_METHODPTR
|| TYPE_IS_REFERENCE (type))))
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;
{
struct field *args = mtype->fields ();
int nargs = mtype->num_fields ();
- int varargs = TYPE_VARARGS (mtype);
+ int varargs = mtype->has_varargs ();
int i;
fprintf_symbol_filtered (stream, prefix,
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()"));
did_print_modifier = 1;
}
- address_space_id = address_space_int_to_name (get_type_arch (type),
- TYPE_INSTANCE_FLAGS (type));
+ address_space_id
+ = address_space_type_instance_flags_to_name (type->arch (),
+ type->instance_flags ());
if (address_space_id)
{
if (did_print_modifier || need_pre_space)
printed_any = 1;
}
- if (printed_any && TYPE_VARARGS (type))
+ if (printed_any && type->has_varargs ())
{
/* Print out a trailing ellipsis for varargs functions. Ignore
TYPE_VARARGS if the function has no named arguments; that
represents unprototyped (K&R style) C functions. */
- if (printed_any && TYPE_VARARGS (type))
+ if (printed_any && type->has_varargs ())
{
fprintf_filtered (stream, ", ");
wrap_here (" ");
}
}
else if (!printed_any
- && (TYPE_PROTOTYPED (type) || language == language_cplus))
+ && (type->is_prototyped () || language == language_cplus))
fprintf_filtered (stream, "void");
fprintf_filtered (stream, ")");
case TYPE_CODE_ARRAY:
{
LONGEST low_bound, high_bound;
- int is_vector = TYPE_VECTOR (type);
+ int is_vector = type->is_vector ();
if (passed_a_ptr)
fprintf_filtered (stream, ")");
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()"));
if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
{
- if (TYPE_STUB (type))
- fprintfi_filtered (level + 4, stream,
- _("%p[<incomplete type>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ if (type->is_stub ())
+ 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);
}
/* Start off with no specific section type, so we can print
print_spaces_filtered (2, stream);
}
- fprintfi_filtered (level, stream, "}");
+ fprintf_filtered (stream, "%*s}", level, "");
}
}
if (TYPE_DECLARED_CLASS (type))
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"))
{
fprintf_filtered (stream, "{\n");
if (type->num_fields () == 0)
{
- if (TYPE_STUB (type))
- fprintfi_filtered (level + 4, stream,
- _("%p[<incomplete type>%p]\n"),
- metadata_style.style ().ptr (), nullptr);
+ if (type->is_stub ())
+ 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);