summaryrefslogtreecommitdiff
path: root/gdb/gnu-v3-abi.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/gnu-v3-abi.c
parentcdfbeec4139a3dc53ce7a061604dea8d8c76f974 (diff)
downloadbinutils-gdb-d3fd12dfc52cf4cbb910830e3ff60dca111f7468.tar.gz
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/gnu-v3-abi.c')
-rw-r--r--gdb/gnu-v3-abi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 45e57c210cb..c928afe6c34 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -135,28 +135,28 @@ build_gdb_vtable_type (struct gdbarch *arch)
offset = 0;
/* ptrdiff_t vcall_and_vbase_offsets[0]; */
- FIELD_NAME (*field) = "vcall_and_vbase_offsets";
+ field->set_name ("vcall_and_vbase_offsets");
field->set_type (lookup_array_range_type (ptrdiff_type, 0, -1));
SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT);
offset += TYPE_LENGTH (field->type ());
field++;
/* ptrdiff_t offset_to_top; */
- FIELD_NAME (*field) = "offset_to_top";
+ field->set_name ("offset_to_top");
field->set_type (ptrdiff_type);
SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT);
offset += TYPE_LENGTH (field->type ());
field++;
/* void *type_info; */
- FIELD_NAME (*field) = "type_info";
+ field->set_name ("type_info");
field->set_type (void_ptr_type);
SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT);
offset += TYPE_LENGTH (field->type ());
field++;
/* void (*virtual_functions[0]) (); */
- FIELD_NAME (*field) = "virtual_functions";
+ field->set_name ("virtual_functions");
field->set_type (lookup_array_range_type (ptr_to_void_fn_type, 0, -1));
SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT);
offset += TYPE_LENGTH (field->type ());
@@ -1036,14 +1036,14 @@ build_std_type_info_type (struct gdbarch *arch)
offset = 0;
/* The vtable. */
- FIELD_NAME (*field) = "_vptr.type_info";
+ field->set_name ("_vptr.type_info");
field->set_type (void_ptr_type);
SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT);
offset += TYPE_LENGTH (field->type ());
field++;
/* The name. */
- FIELD_NAME (*field) = "__name";
+ field->set_name ("__name");
field->set_type (char_ptr_type);
SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT);
offset += TYPE_LENGTH (field->type ());