static int
fat_pntr_bounds_bitpos (struct type *type)
{
- return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
+ return desc_base_type (type)->field (1).loc_bitpos ();
}
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
static int
fat_pntr_data_bitpos (struct type *type)
{
- return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
+ return desc_base_type (type)->field (0).loc_bitpos ();
}
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
static int
desc_bound_bitpos (struct type *type, int i, int which)
{
- return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
+ return desc_base_type (type)->field (2 * i + which - 2).loc_bitpos ();
}
/* If BOUNDS is an array-bounds structure type, return the bit field size
packed; in this case we must take the bit-field path. */
if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0 || value_bitpos (arg1) != 0)
{
- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+ int bit_pos = arg_type->field (fieldno).loc_bitpos ();
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
return ada_value_primitive_packed_val (arg1,
int bit_pos = 0, fld_offset = 0;
if (byte_offset_p != nullptr || bit_offset_p != nullptr)
{
- bit_pos = TYPE_FIELD_BITPOS (type, i);
+ bit_pos = type->field (i).loc_bitpos ();
fld_offset = offset + bit_pos / 8;
}
{
if (find_struct_field (name, field_type->field (j).type (),
fld_offset
- + TYPE_FIELD_BITPOS (field_type, j) / 8,
+ + field_type->field (j).loc_bitpos () / 8,
field_type_p, byte_offset_p,
bit_offset_p, bit_size_p, index_p))
return 1;
int fld_offset = offset;
if (byte_offset_p != nullptr || bit_offset_p != nullptr)
{
- int bit_pos = TYPE_FIELD_BITPOS (type, parent_offset);
+ int bit_pos = type->field (parent_offset).loc_bitpos ();
fld_offset += bit_pos / 8;
}
{
struct value *v = /* Do not let indent join lines here. */
ada_search_struct_field (name, arg,
- offset + TYPE_FIELD_BITPOS (type, i) / 8,
+ offset + type->field (i).loc_bitpos () / 8,
type->field (i).type ());
if (v != NULL)
/* PNH: Do we ever get here? See find_struct_field. */
int j;
struct type *field_type = ada_check_typedef (type->field (i).type ());
- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+ int var_offset = offset + type->field (i).loc_bitpos () / 8;
for (j = 0; j < field_type->num_fields (); j += 1)
{
struct value *v = ada_search_struct_field /* Force line
break. */
(name, arg,
- var_offset + TYPE_FIELD_BITPOS (field_type, j) / 8,
+ var_offset + field_type->field (j).loc_bitpos () / 8,
field_type->field (j).type ());
if (v != NULL)
if (parent_offset != -1)
{
struct value *v = ada_search_struct_field (
- name, arg, offset + TYPE_FIELD_BITPOS (type, parent_offset) / 8,
+ name, arg, offset + type->field (parent_offset).loc_bitpos () / 8,
type->field (parent_offset).type ());
if (v != NULL)
{
struct value *v = /* Do not let indent join lines here. */
ada_index_struct_field_1 (index_p, arg,
- offset + TYPE_FIELD_BITPOS (type, i) / 8,
+ offset + type->field (i).loc_bitpos () / 8,
type->field (i).type ());
if (v != NULL)
for (f = 0; f < nfields; f += 1)
{
off = align_up (off, field_alignment (type, f))
- + TYPE_FIELD_BITPOS (type, f);
+ + type->field (f).loc_bitpos ();
rtype->field (f).set_loc_bitpos (off);
TYPE_FIELD_BITSIZE (rtype, f) = 0;
that follow this one. */
if (ada_is_aligner_type (field_type))
{
- long field_offset = TYPE_FIELD_BITPOS (type, f);
+ long field_offset = type->field (f).loc_bitpos ();
field_valaddr = cond_offset_host (field_valaddr, field_offset);
field_address = cond_offset_target (field_address, field_offset);
{
struct type *branch_type;
- off = TYPE_FIELD_BITPOS (rtype, variant_field);
+ off = rtype->field (variant_field).loc_bitpos ();
if (dval0 == NULL)
{
branch_type = to_fixed_variant_branch_type
(type->field (variant_field).type (),
cond_offset_host (valaddr,
- TYPE_FIELD_BITPOS (type, variant_field)
+ type->field (variant_field).loc_bitpos ()
/ TARGET_CHAR_BIT),
cond_offset_target (address,
- TYPE_FIELD_BITPOS (type, variant_field)
+ type->field (variant_field).loc_bitpos ()
/ TARGET_CHAR_BIT), dval);
if (branch_type == NULL)
{
ada_aligned_value_addr (struct type *type, const gdb_byte *valaddr)
{
if (ada_is_aligner_type (type))
- return ada_aligned_value_addr (type->field (0).type (),
- valaddr +
- TYPE_FIELD_BITPOS (type,
- 0) / TARGET_CHAR_BIT);
+ return ada_aligned_value_addr
+ (type->field (0).type (),
+ valaddr + type->field (0).loc_bitpos () / TARGET_CHAR_BIT);
else
return valaddr;
}
else
{
struct value *v;
- int bit_pos = TYPE_FIELD_BITPOS (type, i);
+ int bit_pos = type->field (i).loc_bitpos ();
int bit_size = TYPE_FIELD_BITSIZE (type, i);
struct value_print_options opts;
|| TYPE_FIELD_PACKED (type, i))
continue;
- int bitpos = TYPE_FIELD_BITPOS (type, i);
+ int bitpos = type->field (i).loc_bitpos ();
if (bitpos % 8 != 0)
return true;
if (field_is_static (&type->field (i)) || bitsize == 0)
return;
- int bitpos = bitoffset + TYPE_FIELD_BITPOS (type, i);
+ int bitpos = bitoffset + type->field (i).loc_bitpos ();
int pos = bitpos / 64;
int endpos = (bitpos + bitsize - 1) / 64;
}
/* If bitpos != 0, then we have to care about it. */
- if (TYPE_FIELD_BITPOS (type, i) != 0)
+ if (type->field (i).loc_bitpos () != 0)
{
/* Bitfields are not addressable. If the field bitsize is
zero, then the field is not packed. Hence it cannot be
if (TYPE_FIELD_PACKED (type, fieldno))
gen_bitfield_ref (ax, value, type->field (fieldno).type (),
(offset * TARGET_CHAR_BIT
- + TYPE_FIELD_BITPOS (type, fieldno)),
+ + type->field (fieldno).loc_bitpos ()),
(offset * TARGET_CHAR_BIT
- + TYPE_FIELD_BITPOS (type, fieldno)
+ + type->field (fieldno).loc_bitpos ()
+ TYPE_FIELD_BITSIZE (type, fieldno)));
else
{
gen_offset (ax, offset
- + TYPE_FIELD_BITPOS (type, fieldno) / TARGET_CHAR_BIT);
+ + type->field (fieldno).loc_bitpos () / TARGET_CHAR_BIT);
value->kind = axs_lvalue_memory;
value->type = type->field (fieldno).type ();
}
/* Make sure we carry our offset when we expand the
struct/union. */
local_podata.offset_bitpos
- = podata->offset_bitpos + TYPE_FIELD_BITPOS (type, i);
+ = podata->offset_bitpos + type->field (i).loc_bitpos ();
/* We're entering a struct/union. Right now,
PODATA->END_BITPOS points right *after* the
struct/union. However, when printing the first field
stream, show, level + 4,
language, &local_flags, podata);
fprintf_filtered (stream, " @%s",
- plongest (TYPE_FIELD_BITPOS (type, i)));
+ plongest (type->field (i).loc_bitpos ()));
if (TYPE_FIELD_BITSIZE (type, i) > 1)
{
fprintf_filtered (stream, "-%s",
- plongest (TYPE_FIELD_BITPOS (type, i)
+ plongest (type->field (i).loc_bitpos ()
+ TYPE_FIELD_BITSIZE (type, i)
- 1));
}
/* Print vtable entry - we only get here if NOT using
-fvtable_thunks. (Otherwise, look under
TYPE_CODE_PTR.) */
- int offset = TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8;
+ int offset = type->field (VTBL_FNADDR_OFFSET).loc_bitpos () / 8;
struct type *field_type = type->field (VTBL_FNADDR_OFFSET).type ();
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
CORE_ADDR addr = extract_typed_address (valaddr + offset, field_type);
type->field (i).name (),
field_type,
bitsize,
- TYPE_FIELD_BITPOS (type, i));
+ type->field (i).loc_bitpos ());
}
context->plugin ().finish_record_or_union (result, TYPE_LENGTH (type));
instance->plugin ().build_field
(field_name, field_type, field_flags, bitsize,
- TYPE_FIELD_BITPOS (type, i));
+ type->field (i).loc_bitpos ());
}
}
}
for (fieldno = 0; fieldno < regs_type->num_fields (); fieldno++)
{
const char *reg_name = regs_type->field (fieldno).name ();
- ULONGEST reg_bitpos = TYPE_FIELD_BITPOS (regs_type, fieldno);
+ ULONGEST reg_bitpos = regs_type->field (fieldno).loc_bitpos ();
ULONGEST reg_bitsize = TYPE_FIELD_BITSIZE (regs_type, fieldno);
ULONGEST reg_offset;
struct type *reg_type
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);
}
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))
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)
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)
ptr_type = type->field (1).type ();
elttype = check_typedef (TYPE_TARGET_TYPE (ptr_type));
addr = unpack_pointer (ptr_type,
- valaddr + TYPE_FIELD_BITPOS (type, 1) / 8
+ valaddr + type->field (1).loc_bitpos () / 8
+ embedded_offset);
true_type = check_typedef (elttype);
}
++name;
- bit_offset += TYPE_FIELD_BITPOS (field_type, index);
+ bit_offset += field_type->field (index).loc_bitpos ();
field_type = field_type->field (index).type ();
}
bounds->num_fields () * sizeof (struct field));
int last_fieldno = range_fields.size () - 1;
- int bounds_size = (TYPE_FIELD_BITPOS (bounds, last_fieldno) / 8
+ int bounds_size = (bounds->field (last_fieldno).loc_bitpos () / 8
+ TYPE_LENGTH (bounds->field (last_fieldno).type ()));
TYPE_LENGTH (bounds) = align_up (bounds_size, max_align);
val = value_cast (field_type, val);
bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
- bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno);
+ bitpos = struct_type->field (fieldno).loc_bitpos ();
addr = value_contents_writeable (struct_val).data () + bitpos / 8;
if (bitsize)
modify_field (struct_type, addr,
if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
- return {&type->field (i), TYPE_FIELD_BITPOS (type, i)};
+ return {&type->field (i), type->field (i).loc_bitpos ()};
}
else if (!t_field_name || *t_field_name == '\0')
{
= lookup_struct_elt (type->field (i).type (), name, 1);
if (elt.field != NULL)
{
- elt.offset += TYPE_FIELD_BITPOS (type, i);
+ elt.offset += type->field (i).loc_bitpos ();
return elt;
}
}
else
{
CORE_ADDR addr = (addr_stack->addr
- + (TYPE_FIELD_BITPOS (type, idx)
+ + (type->field (idx).loc_bitpos ()
/ TARGET_CHAR_BIT));
LONGEST bitsize = TYPE_FIELD_BITSIZE (type, idx);
gdb_byte bits[sizeof (ULONGEST)];
read_memory (addr, bits, size);
- LONGEST bitpos = (TYPE_FIELD_BITPOS (type, idx)
+ LONGEST bitpos = (type->field (idx).loc_bitpos ()
% TARGET_CHAR_BIT);
discr_value = unpack_bits_as_long (type->field (idx).type (),
" (invalid location kind)"));
pinfo.type = check_typedef (resolved_type->field (i).type ());
- size_t offset = TYPE_FIELD_BITPOS (resolved_type, i) / TARGET_CHAR_BIT;
+ size_t offset = resolved_type->field (i).loc_bitpos () / TARGET_CHAR_BIT;
pinfo.valaddr = addr_stack->valaddr;
if (!pinfo.valaddr.empty ())
pinfo.valaddr = pinfo.valaddr.slice (offset);
gdb_assert (resolved_type->field (i).loc_kind ()
== FIELD_LOC_KIND_BITPOS);
- new_bit_length = TYPE_FIELD_BITPOS (resolved_type, i);
+ new_bit_length = resolved_type->field (i).loc_bitpos ();
if (TYPE_FIELD_BITSIZE (resolved_type, i) != 0)
new_bit_length += TYPE_FIELD_BITSIZE (resolved_type, i);
else
idx, plongest (TYPE_FIELD_ENUMVAL (type, idx)));
else
printf_filtered ("%*s[%d] bitpos %s bitsize %d type ", spaces + 2, "",
- idx, plongest (TYPE_FIELD_BITPOS (type, idx)),
+ idx, plongest (type->field (idx).loc_bitpos ()),
TYPE_FIELD_BITSIZE (type, idx));
gdb_print_host_address (type->field (idx).type (), gdb_stdout);
printf_filtered (" name '%s' (",
switch (type->field (i).loc_kind ())
{
case FIELD_LOC_KIND_BITPOS:
- new_type->field (i).set_loc_bitpos (TYPE_FIELD_BITPOS (type, i));
+ new_type->field (i).set_loc_bitpos (type->field (i).loc_bitpos ());
break;
case FIELD_LOC_KIND_ENUMVAL:
new_type->field (i).set_loc_enumval (TYPE_FIELD_ENUMVAL (type, i));
#define TYPE_BASECLASS(thistype,index) ((thistype)->field (index).type ())
#define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses
#define TYPE_BASECLASS_NAME(thistype,index) (thistype->field (index).name ())
-#define TYPE_BASECLASS_BITPOS(thistype,index) TYPE_FIELD_BITPOS(thistype,index)
+#define TYPE_BASECLASS_BITPOS(thistype,index) (thistype->field (index).loc_bitpos ())
#define BASETYPE_VIA_PUBLIC(thistype, index) \
((!TYPE_FIELD_PRIVATE(thistype, index)) && (!TYPE_FIELD_PROTECTED(thistype, index)))
#define TYPE_CPLUS_DYNAMIC(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic
#define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
-#define TYPE_FIELD_BITPOS(thistype, n) ((thistype)->field (n).loc_bitpos ())
#define TYPE_FIELD_ENUMVAL(thistype, n) ((thistype)->field (n).loc_enumval ())
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) ((thistype)->field (n).loc_physname ())
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) ((thistype)->field (n).loc_physaddr ())
CORE_ADDR addr;
field_type = check_typedef (type->field (i).type ());
- field_offset = TYPE_FIELD_BITPOS (type, i) / 8;
+ field_offset = type->field (i).loc_bitpos () / 8;
field_length = TYPE_LENGTH (field_type);
if (!value_bytes_available (val, embedded_offset + field_offset,
struct type *vtable_type
= (struct type *) gdbarch_data (gdbarch, vtable_type_gdbarch_data);
- return (TYPE_FIELD_BITPOS (vtable_type, vtable_field_virtual_functions)
+ return (vtable_type->field (vtable_field_virtual_functions).loc_bitpos ()
/ TARGET_CHAR_BIT);
}
for (i = low_bound; i <= high_bound; i++)
{
bitval = value_bit_index (type->field (field).type (),
- (TYPE_FIELD_BITPOS (type, field) / 8) +
+ (type->field (field).loc_bitpos () / 8) +
valaddr + embedded_offset, i);
if (bitval < 0)
error (_("bit test is out of range"));
const gdb_byte *valaddr = value_contents_for_printing (value).data ();
addr = unpack_pointer (type->field (0).type (),
- (TYPE_FIELD_BITPOS (type, 0) / 8) +
+ (type->field (0).loc_bitpos () / 8) +
valaddr);
val = value_at_lazy (TYPE_TARGET_TYPE (type->field (0).type ()),
/* We're only looking at normal fields. */
if (field_is_static (&arg_type->field (i))
- || (TYPE_FIELD_BITPOS (arg_type, i) % 8) != 0)
+ || (arg_type->field (i).loc_bitpos () % 8) != 0)
continue;
/* If we have gone past the offset, there is no double to pass. */
- pos = TYPE_FIELD_BITPOS (arg_type, i) / 8;
+ pos = arg_type->field (i).loc_bitpos () / 8;
if (pos > offset)
return 0;
&& strcmp (type->field (1).name (), "st") == 0)
{
if (length_pos)
- *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
+ *length_pos = type->field (0).loc_bitpos () / TARGET_CHAR_BIT;
if (length_size)
*length_size = TYPE_LENGTH (type->field (0).type ());
if (string_pos)
- *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ *string_pos = type->field (1).loc_bitpos () / TARGET_CHAR_BIT;
if (char_type)
*char_type = TYPE_TARGET_TYPE (type->field (1).type ());
if (arrayname)
&& strcmp (type->field (1).name (), "length") == 0)
{
if (length_pos)
- *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ *length_pos = type->field (1).loc_bitpos () / TARGET_CHAR_BIT;
if (length_size)
*length_size = TYPE_LENGTH (type->field (1).type ());
if (string_pos)
- *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
+ *string_pos = type->field (2).loc_bitpos () / TARGET_CHAR_BIT;
/* FIXME: how can I detect wide chars in GPC ?? */
if (char_type)
{
print_address_demangle
(options, gdbarch,
extract_unsigned_integer
- (valaddr + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
+ (valaddr + type->field (VTBL_FNADDR_OFFSET).loc_bitpos () / 8,
TYPE_LENGTH (type->field (VTBL_FNADDR_OFFSET).type ()),
byte_order),
stream, demangle);
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);
if (type->field (field).loc_kind () == FIELD_LOC_KIND_DWARF_BLOCK)
arg = gdbpy_ref<>::new_reference (Py_None);
else
- arg = gdb_py_object_from_longest (TYPE_FIELD_BITPOS (type, field));
+ arg = gdb_py_object_from_longest (type->field (field).loc_bitpos ());
attrstring = "bitpos";
}
struct type *field_type = type->field (i).type ();
field_type = check_typedef (field_type);
int field_offset
- = offset + TYPE_FIELD_BITPOS (type, i) / TARGET_CHAR_BIT;
+ = offset + type->field (i).loc_bitpos () / TARGET_CHAR_BIT;
switch (field_type->code ())
{
std::sort (fields.begin (), fields.end (),
[&] (int a, int b)
{
- return (TYPE_FIELD_BITPOS (type, a)
- < TYPE_FIELD_BITPOS (type, b));
+ return (type->field (a).loc_bitpos ()
+ < type->field (b).loc_bitpos ());
});
for (int i : fields)
if (i > 0)
TYPE_LENGTH (result)
- = (TYPE_FIELD_BITPOS (result, i - 1) / TARGET_CHAR_BIT +
+ = (result->field (i - 1).loc_bitpos () / TARGET_CHAR_BIT +
TYPE_LENGTH (result->field (i - 1).type ()));
return result;
}
for (i = 0; i < type->num_fields (); i++)
{
struct type *subtype = check_typedef (type->field (i).type ());
- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+ int subpos = bitpos + type->field (i).loc_bitpos ();
sparc64_store_floating_fields (regcache, subtype, valbuf,
element, subpos);
for (i = 0; i < type->num_fields (); i++)
{
struct type *subtype = check_typedef (type->field (i).type ());
- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+ int subpos = bitpos + type->field (i).loc_bitpos ();
sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos);
}
return;
}
- unsigned int bitpos = TYPE_FIELD_BITPOS (type, field_idx);
+ unsigned int bitpos = type->field (field_idx).loc_bitpos ();
unsigned int fieldsize_byte = TYPE_LENGTH (ftype);
unsigned int fieldsize_bit = fieldsize_byte * TARGET_CHAR_BIT;
have to add the offset of the union here. */
if (field_type->code () == TYPE_CODE_STRUCT
|| (field_type->num_fields () > 0
- && TYPE_FIELD_BITPOS (field_type, 0) == 0))
- new_offset += TYPE_FIELD_BITPOS (type, i) / 8;
+ && field_type->field (0).loc_bitpos () == 0))
+ new_offset += type->field (i).loc_bitpos () / 8;
search (arg1, new_offset, field_type);
}
for (i = TYPE_N_BASECLASSES (t); i < t->num_fields (); i++)
{
if (!field_is_static (&t->field (i))
- && bitpos == TYPE_FIELD_BITPOS (t, i)
+ && bitpos == t->field (i).loc_bitpos ()
&& types_equal (ftype, t->field (i).type ()))
return value_primitive_field (*argp, 0, i, t);
}
if (want_address)
return value_from_longest
(lookup_memberptr_type (t->field (i).type (), domain),
- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
+ offset + (LONGEST) (t->field (i).loc_bitpos () >> 3));
else if (noside != EVAL_NORMAL)
return allocate_value (t->field (i).type ());
else
int. */
&& TYPE_FIELD_BITSIZE (type, field) == 1)
{
- if (val & ((ULONGEST)1 << TYPE_FIELD_BITPOS (type, field)))
+ if (val & ((ULONGEST)1 << type->field (field).loc_bitpos ()))
fprintf_filtered
(stream, " %ps",
styled_string (variable_name_style.style (),
else
{
unsigned field_len = TYPE_FIELD_BITSIZE (type, field);
- ULONGEST field_val = val >> TYPE_FIELD_BITPOS (type, field);
+ ULONGEST field_val = val >> type->field (field).loc_bitpos ();
if (field_len < sizeof (ULONGEST) * TARGET_CHAR_BIT)
field_val &= ((ULONGEST) 1 << field_len) - 1;
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);
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));
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. */
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;
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 ();
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 ());