aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-21 10:36:23 -0600
committerTom Tromey <tromey@adacore.com>2023-11-21 14:52:05 -0700
commit20aadb931ddf2c6c4f9209fffd1fbfda50215342 (patch)
tree14d2c802fac360e1c54896b55f1cc7c652ee619d /gdb/gdbtypes.c
parenta3e9fbf7e889228b091a7454cb5d862ddbc5b7ca (diff)
downloadgdb-20aadb931ddf2c6c4f9209fffd1fbfda50215342.zip
gdb-20aadb931ddf2c6c4f9209fffd1fbfda50215342.tar.gz
gdb-20aadb931ddf2c6c4f9209fffd1fbfda50215342.tar.bz2
Remove some type field accessor macros
This removes TYPE_FIELD_PRIVATE, TYPE_FIELD_PROTECTED, TYPE_FIELD_IGNORE, and TYPE_FIELD_VIRTUAL. In c-varobj.c, match_accessibility can be removed entirely now. Note that the comment before this function was incorrect. Acked-By: Simon Marchi <simon.marchi@efficios.com> Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 8468b9a..aa2fce0 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -5229,33 +5229,34 @@ recursive_dump_type (struct type *type, int spaces)
gdb_printf ("%s\n", host_address_to_string (type->fields ()));
for (idx = 0; idx < type->num_fields (); idx++)
{
+ field &fld = type->field (idx);
if (type->code () == TYPE_CODE_ENUM)
gdb_printf ("%*s[%d] enumval %s type ", spaces + 2, "",
- idx, plongest (type->field (idx).loc_enumval ()));
+ idx, plongest (fld.loc_enumval ()));
else
gdb_printf ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "",
- idx, plongest (type->field (idx).loc_bitpos ()),
- type->field (idx).bitsize ());
+ idx, plongest (fld.loc_bitpos ()),
+ fld.bitsize ());
gdb_printf ("%s name '%s' (%s)",
- host_address_to_string (type->field (idx).type ()),
- type->field (idx).name () != NULL
- ? type->field (idx).name ()
+ host_address_to_string (fld.type ()),
+ fld.name () != NULL
+ ? fld.name ()
: "<NULL>",
- host_address_to_string (type->field (idx).name ()));
- if (TYPE_FIELD_VIRTUAL (type, idx))
+ host_address_to_string (fld.name ()));
+ if (fld.is_virtual ())
gdb_printf (" virtual");
- if (TYPE_FIELD_PRIVATE (type, idx))
+ if (fld.is_private ())
gdb_printf (" private");
- else if (TYPE_FIELD_PROTECTED (type, idx))
+ else if (fld.is_protected ())
gdb_printf (" protected");
- else if (TYPE_FIELD_IGNORE (type, idx))
+ else if (fld.is_ignored ())
gdb_printf (" ignored");
gdb_printf ("\n");
- if (type->field (idx).type () != NULL)
+ if (fld.type () != NULL)
{
- recursive_dump_type (type->field (idx).type (), spaces + 4);
+ recursive_dump_type (fld.type (), spaces + 4);
}
}
if (type->code () == TYPE_CODE_RANGE)