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/target-descriptions.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/target-descriptions.c')
-rw-r--r-- | gdb/target-descriptions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 2ec07a3..20a3a64 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -156,7 +156,7 @@ make_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *ttype) type *element_gdb_type = make_gdb_type (m_gdbarch, e->element_type); m_type = init_vector_type (element_gdb_type, e->count); - TYPE_NAME (m_type) = xstrdup (e->name.c_str ()); + m_type->set_name (xstrdup (e->name.c_str ())); return; } @@ -192,7 +192,7 @@ make_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *ttype) void make_gdb_type_struct (const tdesc_type_with_fields *e) { m_type = arch_composite_type (m_gdbarch, NULL, TYPE_CODE_STRUCT); - TYPE_NAME (m_type) = xstrdup (e->name.c_str ()); + m_type->set_name (xstrdup (e->name.c_str ())); for (const tdesc_type_field &f : e->fields) { @@ -247,7 +247,7 @@ make_gdb_type (struct gdbarch *gdbarch, struct tdesc_type *ttype) void make_gdb_type_union (const tdesc_type_with_fields *e) { m_type = arch_composite_type (m_gdbarch, NULL, TYPE_CODE_UNION); - TYPE_NAME (m_type) = xstrdup (e->name.c_str ()); + m_type->set_name (xstrdup (e->name.c_str ())); for (const tdesc_type_field &f : e->fields) { |