diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-16 12:15:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-16 12:36:05 -0400 |
commit | d0e39ea27cde07011967ab74d39cf13dfe3370c4 (patch) | |
tree | 582ea33260f21ba7bce52e063162fb0c83cd8b0b /gdb/mdebugread.c | |
parent | 2dab0c7ba0d69bcc16cfe58da279ce915ef24348 (diff) | |
download | gdb-d0e39ea27cde07011967ab74d39cf13dfe3370c4.zip gdb-d0e39ea27cde07011967ab74d39cf13dfe3370c4.tar.gz gdb-d0e39ea27cde07011967ab74d39cf13dfe3370c4.tar.bz2 |
gdb: add type::name / type::set_name
Add the `name` and `set_name` methods on `struct type`, in order to
remove the `TYPE_NAME` macro. In this patch, the `TYPE_NAME` macro is
changed to use `type::name`, so all the call sites that are used to set
the type name are changed to use `type::set_name`. The next patch will
remove `TYPE_NAME` completely.
gdb/ChangeLog:
* gdbtypes.h (struct type) <name, set_name>: New methods.
(TYPE_CODE): Use type::name. Change all call sites used to set
the name to use type::set_name instead.
Diffstat (limited to 'gdb/mdebugread.c')
-rw-r--r-- | gdb/mdebugread.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index ba53512..cd08d26 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1010,10 +1010,10 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, (.Fxx or .xxfake or empty) for unnamed struct/union/enums. Alpha cc puts out an sh->iss of zero for those. */ if (sh->iss == 0 || name[0] == '.' || name[0] == '\0') - TYPE_NAME (t) = NULL; + t->set_name (NULL); else - TYPE_NAME (t) = obconcat (&mdebugread_objfile->objfile_obstack, - name, (char *) NULL); + t->set_name (obconcat (&mdebugread_objfile->objfile_obstack, + name, (char *) NULL)); t->set_code (type_code); TYPE_LENGTH (t) = sh->value; @@ -1324,7 +1324,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, for anything except pointers or functions. */ } else - TYPE_NAME (SYMBOL_TYPE (s)) = s->linkage_name (); + SYMBOL_TYPE (s)->set_name (s->linkage_name ()); } break; @@ -1674,11 +1674,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, /* Do not set the tag name if it is a compiler generated tag name (.Fxx or .xxfake or empty) for unnamed struct/union/enums. */ if (name[0] == '.' || name[0] == '\0') - TYPE_NAME (tp) = NULL; + tp->set_name (NULL); else if (TYPE_NAME (tp) == NULL || strcmp (TYPE_NAME (tp), name) != 0) - TYPE_NAME (tp) - = obstack_strdup (&mdebugread_objfile->objfile_obstack, name); + tp->set_name (obstack_strdup (&mdebugread_objfile->objfile_obstack, + name)); } } @@ -1713,8 +1713,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, } if (TYPE_NAME (tp) == NULL || strcmp (TYPE_NAME (tp), name) != 0) - TYPE_NAME (tp) - = obstack_strdup (&mdebugread_objfile->objfile_obstack, name); + tp->set_name (obstack_strdup (&mdebugread_objfile->objfile_obstack, + name)); } } if (t->bt == btTypedef) @@ -4736,7 +4736,7 @@ new_type (char *name) struct type *t; t = alloc_type (mdebugread_objfile); - TYPE_NAME (t) = name; + t->set_name (name); INIT_CPLUS_SPECIFIC (t); return t; } |