diff options
author | Tom Tromey <tromey@adacore.com> | 2023-09-21 10:49:57 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-11-21 14:52:04 -0700 |
commit | 5ffb4736f079c3dbc01be4b6cb961a60094ee18f (patch) | |
tree | 7d719a0499e3f19a6f0312c584873de779c1b1e8 /gdb/gdbtypes.c | |
parent | e626733c050b011c9c9ea950219e04a104c5e96c (diff) | |
download | binutils-5ffb4736f079c3dbc01be4b6cb961a60094ee18f.zip binutils-5ffb4736f079c3dbc01be4b6cb961a60094ee18f.tar.gz binutils-5ffb4736f079c3dbc01be4b6cb961a60094ee18f.tar.bz2 |
Print field accessibility inline
This changes recursive_dump_type to print field accessibility
information "inline". This is clearer and preserves the information
when the byte vectors are removed.
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.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 7241143..1b49628 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5289,12 +5289,23 @@ recursive_dump_type (struct type *type, int spaces) gdb_printf ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "", idx, plongest (type->field (idx).loc_bitpos ()), type->field (idx).bitsize ()); - gdb_printf ("%s name '%s' (%s)\n", + gdb_printf ("%s name '%s' (%s)", host_address_to_string (type->field (idx).type ()), type->field (idx).name () != NULL ? type->field (idx).name () : "<NULL>", host_address_to_string (type->field (idx).name ())); + if (TYPE_FIELD_VIRTUAL (type, idx)) + gdb_printf (" virtual"); + + if (TYPE_FIELD_PRIVATE (type, idx)) + gdb_printf (" private"); + else if (TYPE_FIELD_PROTECTED (type, idx)) + gdb_printf (" protected"); + else if (TYPE_FIELD_IGNORE (type, idx)) + gdb_printf (" ignored"); + + gdb_printf ("\n"); if (type->field (idx).type () != NULL) { recursive_dump_type (type->field (idx).type (), spaces + 4); |