aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.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/value.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/value.c')
-rw-r--r--gdb/value.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/value.c b/gdb/value.c
index b6672c7..e64811f 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3044,7 +3044,7 @@ value_primitive_field (struct value *arg1, LONGEST offset,
bit. Assume that the address, offset, and embedded offset
are sufficiently aligned. */
- LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+ LONGEST bitpos = arg_type->field (fieldno).loc_bitpos ();
LONGEST container_bitsize = TYPE_LENGTH (type) * 8;
v = allocate_value_lazy (type);
@@ -3082,7 +3082,7 @@ value_primitive_field (struct value *arg1, LONGEST offset,
value_address (arg1),
arg1);
else
- boffset = TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
+ boffset = arg_type->field (fieldno).loc_bitpos () / 8;
if (value_lazy (arg1))
v = allocate_value_lazy (value_enclosing_type (arg1));
@@ -3110,7 +3110,7 @@ value_primitive_field (struct value *arg1, LONGEST offset,
else
{
/* Plain old data member */
- offset += (TYPE_FIELD_BITPOS (arg_type, fieldno)
+ offset += (arg_type->field (fieldno).loc_bitpos ()
/ (HOST_CHAR_BIT * unit_size));
/* Lazy register values with offsets are not supported. */
@@ -3274,7 +3274,7 @@ unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr,
LONGEST embedded_offset, int fieldno,
const struct value *val, LONGEST *result)
{
- int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
+ int bitpos = type->field (fieldno).loc_bitpos ();
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
struct type *field_type = type->field (fieldno).type ();
int bit_offset;
@@ -3297,7 +3297,7 @@ unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr,
LONGEST
unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno)
{
- int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
+ int bitpos = type->field (fieldno).loc_bitpos ();
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
struct type *field_type = type->field (fieldno).type ();
@@ -3362,7 +3362,7 @@ value_field_bitfield (struct type *type, int fieldno,
const gdb_byte *valaddr,
LONGEST embedded_offset, const struct value *val)
{
- int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
+ int bitpos = type->field (fieldno).loc_bitpos ();
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
struct value *res_val = allocate_value (type->field (fieldno).type ());