aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-varobj.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-21 10:21:04 -0600
committerTom Tromey <tromey@adacore.com>2023-11-21 14:52:05 -0700
commit61461a5b41fb660ef11a7a9ffe457ea52b5c2a6a (patch)
tree1455a4495a78e319930a706c1dc6cf30689f248c /gdb/c-varobj.c
parent5ffb4736f079c3dbc01be4b6cb961a60094ee18f (diff)
downloadgdb-61461a5b41fb660ef11a7a9ffe457ea52b5c2a6a.zip
gdb-61461a5b41fb660ef11a7a9ffe457ea52b5c2a6a.tar.gz
gdb-61461a5b41fb660ef11a7a9ffe457ea52b5c2a6a.tar.bz2
Remove byte vectors from cplus_struct_type
This removes some byte vectors from cplus_struct_type, moving the information into bitfields in holes in struct field. A new 'enum accessibility' is added to hold some of this information. A similar enum is removed from c-varobj.c. Note that the stabs reader treats "ignored" as an accessibility. However, the stabs texinfo documents this as a public field that is optimized out -- unfortunately nobody has updated the stabs reader to use the better value-based optimized-out machinery. I looked and apparently gcc never emitted this visibility value, so whatever compiler generated this stab is unknown. I left a comment in gdbtypes.h to this effect. Acked-By: Simon Marchi <simon.marchi@efficios.com> Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/c-varobj.c')
-rw-r--r--gdb/c-varobj.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c
index b00a234..543cd58 100644
--- a/gdb/c-varobj.c
+++ b/gdb/c-varobj.c
@@ -669,19 +669,17 @@ cplus_name_of_variable (const struct varobj *parent)
return c_name_of_variable (parent);
}
-enum accessibility { private_field, protected_field, public_field };
-
/* Check if field INDEX of TYPE has the specified accessibility.
Return 0 if so and 1 otherwise. */
static int
match_accessibility (struct type *type, int index, enum accessibility acc)
{
- if (acc == private_field && TYPE_FIELD_PRIVATE (type, index))
+ if (acc == accessibility::PRIVATE && TYPE_FIELD_PRIVATE (type, index))
return 1;
- else if (acc == protected_field && TYPE_FIELD_PROTECTED (type, index))
+ else if (acc == accessibility::PROTECTED && TYPE_FIELD_PROTECTED (type, index))
return 1;
- else if (acc == public_field && !TYPE_FIELD_PRIVATE (type, index)
+ else if (acc == accessibility::PUBLIC && !TYPE_FIELD_PRIVATE (type, index)
&& !TYPE_FIELD_PROTECTED (type, index))
return 1;
else
@@ -737,16 +735,16 @@ cplus_describe_child (const struct varobj *parent, int index,
have the access control we are looking for to properly
find the indexed field. */
int type_index = TYPE_N_BASECLASSES (type);
- enum accessibility acc = public_field;
+ enum accessibility acc = accessibility::PUBLIC;
int vptr_fieldno;
struct type *basetype = NULL;
const char *field_name;
vptr_fieldno = get_vptr_fieldno (type, &basetype);
if (parent->name == "private")
- acc = private_field;
+ acc = accessibility::PRIVATE;
else if (parent->name == "protected")
- acc = protected_field;
+ acc = accessibility::PROTECTED;
while (index >= 0)
{