aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-08-31 11:46:26 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-08-31 13:16:14 -0400
commit3be8c91910114853a64ab87fd1efaef220bb0205 (patch)
tree9028f14b2625d12593d2f5d62cef7b20c1eaaf3d /gdb
parent886176b86503e0b2f7e569fcb96c901fc0d53d52 (diff)
downloadgdb-3be8c91910114853a64ab87fd1efaef220bb0205.zip
gdb-3be8c91910114853a64ab87fd1efaef220bb0205.tar.gz
gdb-3be8c91910114853a64ab87fd1efaef220bb0205.tar.bz2
gdb: remove FIELD_BITSIZE
Replace with field::bitsize. Change-Id: I400be235d6a1f446d0a4aafac01df5e850185d3a Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/read.c2
-rw-r--r--gdb/gdbtypes.c2
-rw-r--r--gdb/gdbtypes.h6
-rw-r--r--gdb/stabsread.c8
4 files changed, 8 insertions, 10 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 79005b6..a538cb5 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -11722,7 +11722,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
}
fp->set_loc_bitpos (fp->loc_bitpos ()
+ anonymous_size * bits_per_byte
- - bit_offset - FIELD_BITSIZE (*fp));
+ - bit_offset - fp->bitsize ());
}
}
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 43c09f8..cd6b191 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4244,7 +4244,7 @@ check_types_equal (struct type *type1, struct type *type2,
const struct field *field2 = &type2->field (i);
if (field1->is_artificial () != field2->is_artificial ()
- || FIELD_BITSIZE (*field1) != FIELD_BITSIZE (*field2)
+ || field1->bitsize () != field2->bitsize ()
|| field1->loc_kind () != field2->loc_kind ())
return false;
if (!compare_maybe_null_strings (field1->name (), field2->name ()))
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 00a792b..6c522a9 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1933,10 +1933,8 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
-#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize ())
-
-#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE((thistype)->field (n))
-#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE((thistype)->field (n))!=0)
+#define TYPE_FIELD_BITSIZE(thistype, n) ((thistype)->field (n).bitsize ())
+#define TYPE_FIELD_PACKED(thistype, n) (((thistype)->field (n).bitsize ())!=0)
#define TYPE_FIELD_PRIVATE_BITS(thistype) \
TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index abc059b..cc7efda 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -2873,7 +2873,7 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp,
}
if (fip->list->field.loc_bitpos () == 0
- && FIELD_BITSIZE (fip->list->field) == 0)
+ && fip->list->field.bitsize () == 0)
{
/* This can happen in two cases: (1) at least for gcc 2.4.5 or so,
it is a field which has been optimized out. The correct stab for
@@ -2908,11 +2908,11 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp,
{
fip->list->field.set_bitsize (0);
}
- if ((FIELD_BITSIZE (fip->list->field)
+ if ((fip->list->field.bitsize ()
== TARGET_CHAR_BIT * field_type->length ()
|| (field_type->code () == TYPE_CODE_ENUM
- && FIELD_BITSIZE (fip->list->field)
- == gdbarch_int_bit (gdbarch))
+ && (fip->list->field.bitsize ()
+ == gdbarch_int_bit (gdbarch)))
)
&&
fip->list->field.loc_bitpos () % 8 == 0)