aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-05-23 17:39:54 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-05-23 17:39:54 -0400
commitceacbf6edf2c72aaa16280205a9bfc8513e9ed27 (patch)
tree0e801f13f8c4c59f584af1e1cd5c9e49b225c3ab /gdb/rust-lang.c
parent26f16254544873f4d7450f6fbbc8f34bf3d2e359 (diff)
downloadgdb-ceacbf6edf2c72aaa16280205a9bfc8513e9ed27.zip
gdb-ceacbf6edf2c72aaa16280205a9bfc8513e9ed27.tar.gz
gdb-ceacbf6edf2c72aaa16280205a9bfc8513e9ed27.tar.bz2
gdb: remove TYPE_FIELD macro
Replace all uses of it by type::field. Note that since type::field returns a reference to the field, some spots are used to assign the whole field structure. See ctfread.c, function attach_fields_to_type, for example. This is the same as was happening with the macro, so I don't think it's a problem, but if anybody sees a really nicer way to do this, now could be a good time to implement it. gdb/ChangeLog: * gdbtypes.h (TYPE_FIELD): Remove. Replace all uses with type::field.
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r--gdb/rust-lang.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index f7eba1d..5958b05 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -128,7 +128,7 @@ rust_underscore_fields (struct type *type)
return false;
for (i = 0; i < type->num_fields (); ++i)
{
- if (!field_is_static (&TYPE_FIELD (type, i)))
+ if (!field_is_static (&type->field (i)))
{
char buf[20];
@@ -420,7 +420,7 @@ val_print_struct (struct value *val, struct ui_file *stream, int recurse,
first_field = 1;
for (i = 0; i < type->num_fields (); ++i)
{
- if (field_is_static (&TYPE_FIELD (type, i)))
+ if (field_is_static (&type->field (i)))
continue;
if (!first_field)
@@ -735,7 +735,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
std::vector<int> fields;
for (int i = 0; i < type->num_fields (); ++i)
{
- if (field_is_static (&TYPE_FIELD (type, i)))
+ if (field_is_static (&type->field (i)))
continue;
if (is_enum && TYPE_FIELD_ARTIFICIAL (type, i))
continue;
@@ -753,7 +753,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
{
QUIT;
- gdb_assert (!field_is_static (&TYPE_FIELD (type, i)));
+ gdb_assert (!field_is_static (&type->field (i)));
gdb_assert (! (is_enum && TYPE_FIELD_ARTIFICIAL (type, i)));
if (flags->print_offsets)
@@ -992,7 +992,7 @@ rust_composite_type (struct type *original,
bitpos = 0;
if (field1 != NULL)
{
- struct field *field = &TYPE_FIELD (result, i);
+ struct field *field = &result->field (i);
SET_FIELD_BITPOS (*field, bitpos);
bitpos += TYPE_LENGTH (type1) * TARGET_CHAR_BIT;
@@ -1003,7 +1003,7 @@ rust_composite_type (struct type *original,
}
if (field2 != NULL)
{
- struct field *field = &TYPE_FIELD (result, i);
+ struct field *field = &result->field (i);
unsigned align = type_align (type2);
if (align != 0)