aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-08-30 11:49:48 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-09-30 22:05:46 -0400
commitd3fd12dfc52cf4cbb910830e3ff60dca111f7468 (patch)
tree14cff3a0dfb01d130942e5e2999ca541cef6c280 /gdb/ada-lang.c
parentcdfbeec4139a3dc53ce7a061604dea8d8c76f974 (diff)
downloadgdb-d3fd12dfc52cf4cbb910830e3ff60dca111f7468.zip
gdb-d3fd12dfc52cf4cbb910830e3ff60dca111f7468.tar.gz
gdb-d3fd12dfc52cf4cbb910830e3ff60dca111f7468.tar.bz2
gdb: add field::name / field::set_name
Add the `name` and `set_name` methods on `struct field`, in order to remove `FIELD_NAME` and `TYPE_FIELD_NAME` macros. In this patch, the macros are changed to use `field::name`, so all the call sites that are used to set the field's name are changed to use `field::set_name`. The next patch will remove the macros completely. Note that because of the name clash between the existing field named `name` and the new method, I renamed the field `m_name`. It is not private per-se, because we can't make `struct field` a non-POD yet, but it should be considered private anyway (not accessed outside `struct field`). Change-Id: If16ddbca4e0c39d0ff9da420bb5cdebe5b9b0896
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a00fa14..cb011a5 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7601,7 +7601,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
ada_ensure_varsize_limit (field_type);
rtype->field (f).set_type (field_type);
- TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
+ rtype->field (f).set_name (TYPE_FIELD_NAME (type, f));
/* The multiplication can potentially overflow. But because
the field length has been size-checked just above, and
assuming that the maximum size is a reasonable value,
@@ -7624,7 +7624,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
to distinguish between the two options. Stripping it
would prevent us from printing this field appropriately. */
rtype->field (f).set_type (type->field (f).type ());
- TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
+ rtype->field (f).set_name (TYPE_FIELD_NAME (type, f));
if (TYPE_FIELD_BITSIZE (type, f) > 0)
fld_bit_len =
TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f);
@@ -7686,7 +7686,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
else
{
rtype->field (variant_field).set_type (branch_type);
- TYPE_FIELD_NAME (rtype, variant_field) = "S";
+ rtype->field (variant_field).set_name ("S");
fld_bit_len =
TYPE_LENGTH (rtype->field (variant_field).type ()) *
TARGET_CHAR_BIT;
@@ -7802,7 +7802,7 @@ template_to_static_fixed_type (struct type *type0)
TYPE_LENGTH (type) = 0;
}
type->field (f).set_type (new_type);
- TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (type0, f);
+ type->field (f).set_name (TYPE_FIELD_NAME (type0, f));
}
}
@@ -7871,7 +7871,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
else
{
rtype->field (variant_field).set_type (branch_type);
- TYPE_FIELD_NAME (rtype, variant_field) = "S";
+ rtype->field (variant_field).set_name ("S");
TYPE_FIELD_BITSIZE (rtype, variant_field) = 0;
TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type);
}