mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
gdb: remove TYPE_LENGTH
Remove the macro, replace all uses with calls to type::length. Change-Id: Ib9bdc954576860b21190886534c99103d6a47afb
This commit is contained in:
@@ -194,21 +194,21 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg,
|
||||
/* If we don't have a prototype, coerce to integer type if necessary. */
|
||||
if (!is_prototyped)
|
||||
{
|
||||
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin->builtin_int))
|
||||
if (type->length () < builtin->builtin_int->length ())
|
||||
type = builtin->builtin_int;
|
||||
}
|
||||
/* Currently all target ABIs require at least the width of an integer
|
||||
type for an argument. We may have to conditionalize the following
|
||||
type coercion for future targets. */
|
||||
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin->builtin_int))
|
||||
if (type->length () < builtin->builtin_int->length ())
|
||||
type = builtin->builtin_int;
|
||||
break;
|
||||
case TYPE_CODE_FLT:
|
||||
if (!is_prototyped && coerce_float_to_double_p)
|
||||
{
|
||||
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin->builtin_double))
|
||||
if (type->length () < builtin->builtin_double->length ())
|
||||
type = builtin->builtin_double;
|
||||
else if (TYPE_LENGTH (type) > TYPE_LENGTH (builtin->builtin_double))
|
||||
else if (type->length () > builtin->builtin_double->length ())
|
||||
type = builtin->builtin_long_double;
|
||||
}
|
||||
break;
|
||||
@@ -307,7 +307,7 @@ find_function_addr (struct value *function,
|
||||
{
|
||||
/* Handle the case of functions lacking debugging info.
|
||||
Their values are characters since their addresses are char. */
|
||||
if (TYPE_LENGTH (ftype) == 1)
|
||||
if (ftype->length () == 1)
|
||||
funaddr = value_as_address (value_addr (function));
|
||||
else
|
||||
{
|
||||
@@ -452,7 +452,7 @@ get_call_return_value (struct call_return_meta_info *ri)
|
||||
retval = allocate_value (ri->value_type);
|
||||
read_value_memory (retval, 0, 1, ri->struct_addr,
|
||||
value_contents_raw (retval).data (),
|
||||
TYPE_LENGTH (ri->value_type));
|
||||
ri->value_type->length ());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -681,7 +681,7 @@ reserve_stack_space (const type *values_type, CORE_ADDR &sp)
|
||||
{
|
||||
/* Stack grows downward. Align STRUCT_ADDR and SP after
|
||||
making space. */
|
||||
sp -= TYPE_LENGTH (values_type);
|
||||
sp -= values_type->length ();
|
||||
if (gdbarch_frame_align_p (gdbarch))
|
||||
sp = gdbarch_frame_align (gdbarch, sp);
|
||||
addr = sp;
|
||||
@@ -693,7 +693,7 @@ reserve_stack_space (const type *values_type, CORE_ADDR &sp)
|
||||
if (gdbarch_frame_align_p (gdbarch))
|
||||
sp = gdbarch_frame_align (gdbarch, sp);
|
||||
addr = sp;
|
||||
sp += TYPE_LENGTH (values_type);
|
||||
sp += values_type->length ();
|
||||
if (gdbarch_frame_align_p (gdbarch))
|
||||
sp = gdbarch_frame_align (gdbarch, sp);
|
||||
}
|
||||
@@ -926,7 +926,7 @@ call_function_by_hand_dummy (struct value *function,
|
||||
else
|
||||
{
|
||||
gdb_assert (sp <= lastval_addr);
|
||||
sp = lastval_addr + TYPE_LENGTH (value_type (lastval));
|
||||
sp = lastval_addr + value_type (lastval)->length ();
|
||||
}
|
||||
|
||||
if (gdbarch_frame_align_p (gdbarch))
|
||||
@@ -1083,7 +1083,7 @@ call_function_by_hand_dummy (struct value *function,
|
||||
|
||||
if (info.trivially_copy_constructible)
|
||||
{
|
||||
int length = TYPE_LENGTH (param_type);
|
||||
int length = param_type->length ();
|
||||
write_memory (addr, value_contents (args[i]).data (), length);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user