aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.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/findvar.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/findvar.c')
-rw-r--r--gdb/findvar.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 36c0945..b388d82 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -318,7 +318,7 @@ unsigned_pointer_to_address (struct gdbarch *gdbarch,
{
enum bfd_endian byte_order = type_byte_order (type);
- return extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
+ return extract_unsigned_integer (buf, type->length (), byte_order);
}
CORE_ADDR
@@ -327,7 +327,7 @@ signed_pointer_to_address (struct gdbarch *gdbarch,
{
enum bfd_endian byte_order = type_byte_order (type);
- return extract_signed_integer (buf, TYPE_LENGTH (type), byte_order);
+ return extract_signed_integer (buf, type->length (), byte_order);
}
/* Given an address, store it as a pointer of type TYPE in target
@@ -338,7 +338,7 @@ unsigned_address_to_pointer (struct gdbarch *gdbarch, struct type *type,
{
enum bfd_endian byte_order = type_byte_order (type);
- store_unsigned_integer (buf, TYPE_LENGTH (type), byte_order, addr);
+ store_unsigned_integer (buf, type->length (), byte_order, addr);
}
void
@@ -347,7 +347,7 @@ address_to_signed_pointer (struct gdbarch *gdbarch, struct type *type,
{
enum bfd_endian byte_order = type_byte_order (type);
- store_signed_integer (buf, TYPE_LENGTH (type), byte_order, addr);
+ store_signed_integer (buf, type->length (), byte_order, addr);
}
/* See value.h. */
@@ -595,7 +595,7 @@ language_defn::read_var_value (struct symbol *var,
}
/* Put the constant back in target format. */
v = allocate_value (type);
- store_signed_integer (value_contents_raw (v).data (), TYPE_LENGTH (type),
+ store_signed_integer (value_contents_raw (v).data (), type->length (),
type_byte_order (type), var->value_longest ());
VALUE_LVAL (v) = not_lval;
return v;
@@ -624,7 +624,7 @@ language_defn::read_var_value (struct symbol *var,
}
v = allocate_value (type);
memcpy (value_contents_raw (v).data (), var->value_bytes (),
- TYPE_LENGTH (type));
+ type->length ());
VALUE_LVAL (v) = not_lval;
return v;
@@ -796,7 +796,7 @@ struct value *
default_value_from_register (struct gdbarch *gdbarch, struct type *type,
int regnum, struct frame_id frame_id)
{
- int len = TYPE_LENGTH (type);
+ int len = type->length ();
struct value *value = allocate_value (type);
struct frame_info *frame;
@@ -902,9 +902,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
if (!ok)
{
if (optim)
- mark_value_bytes_optimized_out (v, 0, TYPE_LENGTH (type));
+ mark_value_bytes_optimized_out (v, 0, type->length ());
if (unavail)
- mark_value_bytes_unavailable (v, 0, TYPE_LENGTH (type));
+ mark_value_bytes_unavailable (v, 0, type->length ());
}
}
else
@@ -947,7 +947,7 @@ address_from_register (int regnum, struct frame_info *frame)
pointer types. Avoid constructing a value object in those cases. */
if (gdbarch_convert_register_p (gdbarch, regnum, type))
{
- gdb_byte *buf = (gdb_byte *) alloca (TYPE_LENGTH (type));
+ gdb_byte *buf = (gdb_byte *) alloca (type->length ());
int optim, unavail, ok;
ok = gdbarch_register_to_value (gdbarch, frame, regnum, type,