aboutsummaryrefslogtreecommitdiff
path: root/gdb/mep-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-09-21 11:05:21 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-09-21 11:05:21 -0400
commitdf86565b31bf12aab6fdceade49169bc6f378b13 (patch)
tree76d5944661919552ce4ea01ac49188e151d72fa7 /gdb/mep-tdep.c
parentb6cdbc9a8173b9e6cc8cfc284caa0efa8129ca02 (diff)
downloadgdb-df86565b31bf12aab6fdceade49169bc6f378b13.zip
gdb-df86565b31bf12aab6fdceade49169bc6f378b13.tar.gz
gdb-df86565b31bf12aab6fdceade49169bc6f378b13.tar.bz2
gdb: remove TYPE_LENGTH
Remove the macro, replace all uses with calls to type::length. Change-Id: Ib9bdc954576860b21190886534c99103d6a47afb
Diffstat (limited to 'gdb/mep-tdep.c')
-rw-r--r--gdb/mep-tdep.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 66b7656..555eb5e 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -1131,8 +1131,8 @@ mep_pseudo_cr32_read (struct gdbarch *gdbarch,
int rawnum = mep_pseudo_to_raw[cookednum];
gdb_byte buf64[8];
- gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
- gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
+ gdb_assert (register_type (gdbarch, rawnum)->length () == sizeof (buf64));
+ gdb_assert (register_type (gdbarch, cookednum)->length () == 4);
status = regcache->raw_read (rawnum, buf64);
if (status == REG_VALID)
{
@@ -1217,8 +1217,8 @@ mep_pseudo_cr32_write (struct gdbarch *gdbarch,
int rawnum = mep_pseudo_to_raw[cookednum];
gdb_byte buf64[8];
- gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
- gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
+ gdb_assert (register_type (gdbarch, rawnum)->length () == sizeof (buf64));
+ gdb_assert (register_type (gdbarch, cookednum)->length () == 4);
/* Slow, but legible. */
store_unsigned_integer (buf64, 8, byte_order,
extract_unsigned_integer (buf, 4, byte_order));
@@ -2075,7 +2075,7 @@ static const struct frame_unwind mep_frame_unwind = {
static int
mep_use_struct_convention (struct type *type)
{
- return (TYPE_LENGTH (type) > MEP_GPR_SIZE);
+ return (type->length () > MEP_GPR_SIZE);
}
@@ -2094,15 +2094,15 @@ mep_extract_return_value (struct gdbarch *arch,
/* Return values > MEP_GPR_SIZE bytes are returned in memory,
pointed to by R0. */
- gdb_assert (TYPE_LENGTH (type) <= MEP_GPR_SIZE);
+ gdb_assert (type->length () <= MEP_GPR_SIZE);
if (byte_order == BFD_ENDIAN_BIG)
- offset = MEP_GPR_SIZE - TYPE_LENGTH (type);
+ offset = MEP_GPR_SIZE - type->length ();
else
offset = 0;
/* Return values that do fit in a single register are returned in R0. */
- regcache->cooked_read_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+ regcache->cooked_read_part (MEP_R0_REGNUM, offset, type->length (),
valbuf);
}
@@ -2116,7 +2116,7 @@ mep_store_return_value (struct gdbarch *arch,
int byte_order = gdbarch_byte_order (arch);
/* Values that fit in a single register go in R0. */
- if (TYPE_LENGTH (type) <= MEP_GPR_SIZE)
+ if (type->length () <= MEP_GPR_SIZE)
{
/* Values that don't occupy a full register appear at the least
significant end of the value. This is the offset to where the
@@ -2124,11 +2124,11 @@ mep_store_return_value (struct gdbarch *arch,
int offset;
if (byte_order == BFD_ENDIAN_BIG)
- offset = MEP_GPR_SIZE - TYPE_LENGTH (type);
+ offset = MEP_GPR_SIZE - type->length ();
else
offset = 0;
- regcache->cooked_write_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+ regcache->cooked_write_part (MEP_R0_REGNUM, offset, type->length (),
valbuf);
}
@@ -2156,7 +2156,7 @@ mep_return_value (struct gdbarch *gdbarch, struct value *function,
returned in R0. Fetch R0's value and then read the memory
at that address. */
regcache_raw_read_unsigned (regcache, MEP_R0_REGNUM, &addr);
- read_memory (addr, readbuf, TYPE_LENGTH (type));
+ read_memory (addr, readbuf, type->length ());
}
if (writebuf)
{
@@ -2228,7 +2228,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv,
for (i = 0; i < argc; i++)
{
- unsigned arg_len = TYPE_LENGTH (value_type (argv[i]));
+ unsigned arg_len = value_type (argv[i])->length ();
if (arg_len > MEP_GPR_SIZE)
{
@@ -2288,9 +2288,9 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
ULONGEST value;
/* Arguments that fit in a GPR get expanded to fill the GPR. */
- if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
+ if (value_type (argv[i])->length () <= MEP_GPR_SIZE)
value = extract_unsigned_integer (value_contents (argv[i]).data (),
- TYPE_LENGTH (value_type (argv[i])),
+ value_type (argv[i])->length (),
byte_order);
/* Arguments too large to fit in a GPR get copied to the stack,