aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-valprint.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-09-26 16:36:15 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-10-29 16:44:44 -0400
commitb610c04548a39dbce6d51c33d7a8125e59066939 (patch)
tree9ebf5e8721754311148f61ea22e71126a8318574 /gdb/cp-valprint.c
parent2ad53ea10c14445d6074814bbdfe46bd787038cb (diff)
downloadgdb-b610c04548a39dbce6d51c33d7a8125e59066939.zip
gdb-b610c04548a39dbce6d51c33d7a8125e59066939.tar.gz
gdb-b610c04548a39dbce6d51c33d7a8125e59066939.tar.bz2
gdb: remove TYPE_FIELD_BITPOS
Remove TYPE_FIELD_BITPOS, replace its uses with type::field + field::loc_bitpos. Change-Id: Iccd8d5a77e5352843a837babaa6bd284162e0320
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r--gdb/cp-valprint.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 1023728..2788410 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -270,11 +270,9 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
- else if (value_bits_synthetic_pointer (val,
- TYPE_FIELD_BITPOS (type,
- i),
- TYPE_FIELD_BITSIZE (type,
- i)))
+ else if (value_bits_synthetic_pointer
+ (val, type->field (i).loc_bitpos (),
+ TYPE_FIELD_BITSIZE (type, i)))
{
fputs_styled (_("<synthetic pointer>"),
metadata_style.style (), stream);
@@ -316,7 +314,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
}
else if (i == vptr_fieldno && type == vptr_basetype)
{
- int i_offset = TYPE_FIELD_BITPOS (type, i) / 8;
+ int i_offset = type->field (i).loc_bitpos () / 8;
struct type *i_type = type->field (i).type ();
if (valprint_check_validity (stream, i_type, i_offset, val))
@@ -638,7 +636,7 @@ cp_find_class_member (struct type **self_p, int *fieldno,
for (i = TYPE_N_BASECLASSES (self); i < len; i++)
{
- LONGEST bitpos = TYPE_FIELD_BITPOS (self, i);
+ LONGEST bitpos = self->field (i).loc_bitpos ();
QUIT;
if (offset == bitpos)
@@ -650,7 +648,7 @@ cp_find_class_member (struct type **self_p, int *fieldno,
for (i = 0; i < TYPE_N_BASECLASSES (self); i++)
{
- LONGEST bitpos = TYPE_FIELD_BITPOS (self, i);
+ LONGEST bitpos = self->field (i).loc_bitpos ();
LONGEST bitsize = 8 * TYPE_LENGTH (self->field (i).type ());
if (offset >= bitpos && offset < bitpos + bitsize)