/* Support for printing C++ values 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.
|| type->code () == TYPE_CODE_PTR) /* if using thunks */
{
/* Virtual functions tables are full of pointers
- to virtual functions. */
+ to virtual functions. */
return cp_is_vtbl_ptr_type (type);
}
}
/* If requested, skip printing of static fields. */
if (!options->static_field_print
- && field_is_static (&TYPE_FIELD (type, i)))
+ && field_is_static (&type->field (i)))
continue;
if (fields_seen)
wrap_here (n_spaces (2 + 2 * recurse));
}
- annotate_field_begin (TYPE_FIELD_TYPE (type, i));
+ annotate_field_begin (type->field (i).type ());
- if (field_is_static (&TYPE_FIELD (type, i)))
+ if (field_is_static (&type->field (i)))
{
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream,
}
annotate_field_value ();
- if (!field_is_static (&TYPE_FIELD (type, i))
+ if (!field_is_static (&type->field (i))
&& TYPE_FIELD_PACKED (type, i))
{
struct value *v;
/* Bitfields require special handling, especially due to
- byte order problems. */
+ byte order problems. */
if (TYPE_FIELD_IGNORE (type, i))
{
fputs_styled ("<optimized out or zero length>",
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
- else if (field_is_static (&TYPE_FIELD (type, i)))
+ else if (field_is_static (&type->field (i)))
{
try
{
struct value *v = value_static_field (type, i);
- cp_print_static_field (TYPE_FIELD_TYPE (type, i),
+ cp_print_static_field (type->field (i).type (),
v, stream, recurse + 1,
opts);
}
else if (i == vptr_fieldno && type == vptr_basetype)
{
int i_offset = TYPE_FIELD_BITPOS (type, i) / 8;
- struct type *i_type = TYPE_FIELD_TYPE (type, i);
+ struct type *i_type = type->field (i).type ();
if (valprint_check_validity (stream, i_type, i_offset, val))
{
i_offset += value_embedded_offset (val);
addr = extract_typed_address (valaddr + i_offset, i_type);
print_function_pointer_address (opts,
- get_type_arch (type),
+ type->arch (),
addr, stream);
}
}
if (dont_print_statmem == 0)
{
size_t obstack_final_size =
- obstack_object_size (&dont_print_statmem_obstack);
+ obstack_object_size (&dont_print_statmem_obstack);
if (obstack_final_size > statmem_obstack_initial_size)
{
if (dont_print_vb == 0)
{
/* If we're at top level, carve out a completely fresh chunk of
- the obstack and use that until this particular invocation
- returns. */
+ the obstack and use that until this particular invocation
+ returns. */
/* Bump up the high-water mark. Now alpha is omega. */
obstack_finish (&dont_print_vb_obstack);
}
}
fputs_filtered ("<", stream);
/* Not sure what the best notation is in the case where there is
- no baseclass name. */
+ no baseclass name. */
fputs_filtered (basename ? basename : "", stream);
fputs_filtered ("> = ", stream);
&& recurse >= options->max_depth)
{
const struct language_defn *language = current_language;
- gdb_assert (language->la_struct_too_deep_ellipsis != NULL);
- fputs_filtered (language->la_struct_too_deep_ellipsis, stream);
+ gdb_assert (language->struct_too_deep_ellipsis () != NULL);
+ fputs_filtered (language->struct_too_deep_ellipsis (), stream);
}
else
{
if (dont_print_vb == 0)
{
/* Free the space used to deal with the printing
- of this type from top level. */
+ of this type from top level. */
obstack_free (&dont_print_vb_obstack, last_dont_print);
/* Reset watermark so that we can continue protecting
- ourselves from whatever we were protecting ourselves. */
+ ourselves from whatever we were protecting ourselves. */
dont_print_vb_obstack = tmp_obstack;
}
}
for (i = 0; i < TYPE_N_BASECLASSES (self); i++)
{
LONGEST bitpos = TYPE_FIELD_BITPOS (self, i);
- LONGEST bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (self, i));
+ LONGEST bitsize = 8 * TYPE_LENGTH (self->field (i).type ());
if (offset >= bitpos && offset < bitpos + bitsize)
{
- *self_p = TYPE_FIELD_TYPE (self, i);
+ *self_p = self->field (i).type ();
cp_find_class_member (self_p, fieldno, offset - bitpos);
return;
}