aboutsummaryrefslogtreecommitdiff
path: root/gdb/mdebugread.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/mdebugread.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/mdebugread.c')
-rw-r--r--gdb/mdebugread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 026f2ff..3e560ae 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -1058,13 +1058,13 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SET_FIELD_ENUMVAL (*f, tsym.value);
f->set_type (t);
- FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss;
+ f->set_name (debug_info->ss + cur_fdr->issBase + tsym.iss);
FIELD_BITSIZE (*f) = 0;
enum_sym = new (&mdebugread_objfile->objfile_obstack) symbol;
enum_sym->set_linkage_name
(obstack_strdup (&mdebugread_objfile->objfile_obstack,
- f->name));
+ f->name ()));
SYMBOL_ACLASS_INDEX (enum_sym) = LOC_CONST;
SYMBOL_TYPE (enum_sym) = t;
SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
@@ -1241,7 +1241,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
{
struct field *f = &top_stack->cur_type->field (top_stack->cur_field);
top_stack->cur_field++;
- FIELD_NAME (*f) = name;
+ f->set_name (name);
SET_FIELD_BITPOS (*f, sh->value);
bitsize = 0;
f->set_type (parse_type (cur_fd, ax, sh->index, &bitsize, bigend,