aboutsummaryrefslogtreecommitdiff
path: root/gdb/ctfread.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/ctfread.c
parentcdfbeec4139a3dc53ce7a061604dea8d8c76f974 (diff)
downloadbinutils-d3fd12dfc52cf4cbb910830e3ff60dca111f7468.zip
binutils-d3fd12dfc52cf4cbb910830e3ff60dca111f7468.tar.gz
binutils-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/ctfread.c')
-rw-r--r--gdb/ctfread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ctfread.c b/gdb/ctfread.c
index 01334e4..3d2cb11 100644
--- a/gdb/ctfread.c
+++ b/gdb/ctfread.c
@@ -399,7 +399,7 @@ ctf_add_member_cb (const char *name,
uint32_t kind;
fp = &new_field.field;
- FIELD_NAME (*fp) = name;
+ fp->set_name (name);
kind = ctf_type_kind (ccp->fp, tid);
t = fetch_tid_type (ccp, tid);
@@ -438,7 +438,7 @@ ctf_add_enum_member_cb (const char *name, int enum_value, void *arg)
struct ctf_context *ccp = fip->cur_context;
fp = &new_field.field;
- FIELD_NAME (*fp) = name;
+ fp->set_name (name);
fp->set_type (nullptr);
SET_FIELD_ENUMVAL (*fp, enum_value);
FIELD_BITSIZE (*fp) = 0;