+2020-05-16 Simon Marchi <simon.marchi@efficios.com>
+
+ * 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.
+
2020-05-16 Tom Tromey <tom@tromey.com>
* top.c (quit_force): Update.
elt_bits);
create_array_type (new_type, new_elt_type, index_type);
TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
- TYPE_NAME (new_type) = ada_type_name (type);
+ new_type->set_name (ada_type_name (type));
if ((check_typedef (index_type)->code () == TYPE_CODE_RANGE
&& is_dynamic_type (check_typedef (index_type)))
TYPE_NFIELDS (type) = 0;
TYPE_FIELDS (type) = NULL;
INIT_NONE_SPECIFIC (type);
- TYPE_NAME (type) = "<empty>";
+ type->set_name ("<empty>");
TYPE_LENGTH (type) = 0;
return type;
}
TYPE_FIELDS (rtype) = (struct field *)
TYPE_ALLOC (rtype, nfields * sizeof (struct field));
memset (TYPE_FIELDS (rtype), 0, sizeof (struct field) * nfields);
- TYPE_NAME (rtype) = ada_type_name (type);
+ rtype->set_name (ada_type_name (type));
TYPE_FIXED_INSTANCE (rtype) = 1;
off = 0;
TYPE_ALLOC (type, nfields * sizeof (struct field));
memcpy (TYPE_FIELDS (type), TYPE_FIELDS (type0),
sizeof (struct field) * nfields);
- TYPE_NAME (type) = ada_type_name (type0);
+ type->set_name (ada_type_name (type0));
TYPE_FIXED_INSTANCE (type) = 1;
TYPE_LENGTH (type) = 0;
}
(struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field));
memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type),
sizeof (struct field) * nfields);
- TYPE_NAME (rtype) = ada_type_name (type);
+ rtype->set_name (ada_type_name (type));
TYPE_FIXED_INSTANCE (rtype) = 1;
TYPE_LENGTH (rtype) = TYPE_LENGTH (type);
/* We want to preserve the type name. This can be useful when
trying to get the type name of a value that has already been
printed (for instance, if the user did "print VAR; whatis $". */
- TYPE_NAME (result) = TYPE_NAME (type0);
+ result->set_name (TYPE_NAME (type0));
if (constrained_packed_array_p)
{
{
struct type *type1 = TYPE_FIELD_TYPE (ada_check_typedef (type), 0);
if (ada_type_name (type1) == NULL)
- TYPE_NAME (type1) = ada_type_name (type);
+ type1->set_name (ada_type_name (type));
return static_unwrap_type (type1);
}
struct type *val_type = ada_check_typedef (value_type (v));
if (ada_type_name (val_type) == NULL)
- TYPE_NAME (val_type) = ada_type_name (type);
+ val_type->set_name (ada_type_name (type));
return unwrap_value (v);
}
to match the size of the base_type, which is not what we want.
Set it back to the original range type's length. */
TYPE_LENGTH (type) = TYPE_LENGTH (raw_type);
- TYPE_NAME (type) = name;
+ type->set_name (name);
return type;
}
}
lai->primitive_type_vector [ada_primitive_type_system_address]
= lookup_pointer_type (arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT,
"void"));
- TYPE_NAME (lai->primitive_type_vector [ada_primitive_type_system_address])
- = "system__address";
+ lai->primitive_type_vector [ada_primitive_type_system_address]
+ ->set_name ("system__address");
/* Create the equivalent of the System.Storage_Elements.Storage_Offset
type. This is a signed integral type whose size is the same as
append_composite_type_field (t, "f64", elem);
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "neon_d";
+ t->set_name ("neon_d");
tdep->neon_double_type = t;
}
append_composite_type_field (t, "f64", init_vector_type (elem, 2));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "neon_q";
+ t->set_name ("neon_q");
tdep->neon_quad_type = t;
}
process_coff_symbol. */
if (TYPE_NAME (target))
xfree ((char*) TYPE_NAME (target));
- TYPE_NAME (target) = xstrdup (TYPE_NAME (real_target));
+ target->set_name (xstrdup (TYPE_NAME (real_target)));
}
}
;
}
else
- TYPE_NAME (SYMBOL_TYPE (sym)) =
- xstrdup (sym->linkage_name ());
+ SYMBOL_TYPE (sym)->set_name (xstrdup (sym->linkage_name ()));
}
/* Keep track of any type which points to empty structured
if (sym->linkage_name () != NULL
&& *sym->linkage_name () != '~'
&& *sym->linkage_name () != '.')
- TYPE_NAME (SYMBOL_TYPE (sym)) = xstrdup (sym->linkage_name ());
+ SYMBOL_TYPE (sym)->set_name (xstrdup (sym->linkage_name ()));
add_symbol_to_list (sym, get_file_symbols ());
break;
/* Anonymous structure type. */
type = coff_alloc_type (cs->c_symnum);
type->set_code (TYPE_CODE_STRUCT);
- TYPE_NAME (type) = NULL;
+ type->set_name (NULL);
INIT_CPLUS_SPECIFIC (type);
TYPE_LENGTH (type) = 0;
TYPE_FIELDS (type) = 0;
{
/* Anonymous union type. */
type = coff_alloc_type (cs->c_symnum);
- TYPE_NAME (type) = NULL;
+ type->set_name (NULL);
INIT_CPLUS_SPECIFIC (type);
TYPE_LENGTH (type) = 0;
TYPE_FIELDS (type) = 0;
/* Anonymous enum type. */
type = coff_alloc_type (cs->c_symnum);
type->set_code (TYPE_CODE_ENUM);
- TYPE_NAME (type) = NULL;
+ type->set_name (NULL);
TYPE_LENGTH (type) = 0;
TYPE_FIELDS (type) = 0;
TYPE_NFIELDS (type) = 0;
init_vector_type (bt->builtin_int8, 16));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "builtin_type_vec128i";
+ t->set_name ("builtin_type_vec128i");
return t;
}
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL && strlen (name.get() ) != 0)
- TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
+ type->set_name (obstack_strdup (&of->objfile_obstack, name.get ()));
kind = ctf_type_kind (fp, tid);
if (kind == CTF_K_UNION)
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL && strlen (name.get ()) != 0)
- TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
+ type->set_name (obstack_strdup (&of->objfile_obstack, name.get ()));
type->set_code (TYPE_CODE_FUNC);
ctf_func_type_info (fp, tid, &cfi);
gdb::unique_xmalloc_ptr<char> name (ctf_type_aname_raw (fp, tid));
if (name != NULL && strlen (name.get ()) != 0)
- TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
+ type->set_name (obstack_strdup (&of->objfile_obstack, name.get ()));
type->set_code (TYPE_CODE_ENUM);
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
TYPE_FIELD (type, 1) = saved_field;
TYPE_FIELD_NAME (type, 1)
= rust_last_path_segment (TYPE_NAME (TYPE_FIELD_TYPE (type, 1)));
- TYPE_NAME (TYPE_FIELD_TYPE (type, 1))
- = rust_fully_qualify (&objfile->objfile_obstack, TYPE_NAME (type),
- TYPE_FIELD_NAME (type, 1));
+ TYPE_FIELD_TYPE (type, 1)->set_name
+ (rust_fully_qualify (&objfile->objfile_obstack, TYPE_NAME (type),
+ TYPE_FIELD_NAME (type, 1)));
const char *dataless_name
= rust_fully_qualify (&objfile->objfile_obstack, TYPE_NAME (type),
const char *variant_name
= rust_last_path_segment (TYPE_NAME (field_type));
TYPE_FIELD_NAME (type, 0) = variant_name;
- TYPE_NAME (field_type)
- = rust_fully_qualify (&objfile->objfile_obstack,
- TYPE_NAME (type), variant_name);
+ field_type->set_name
+ (rust_fully_qualify (&objfile->objfile_obstack,
+ TYPE_NAME (type), variant_name));
}
else
{
++TYPE_FIELDS (sub_type);
}
TYPE_FIELD_NAME (type, i) = variant_name;
- TYPE_NAME (sub_type)
- = rust_fully_qualify (&objfile->objfile_obstack,
- TYPE_NAME (type), variant_name);
+ sub_type->set_name
+ (rust_fully_qualify (&objfile->objfile_obstack,
+ TYPE_NAME (type), variant_name));
}
/* Indicate that this is a variant type. */
if (get_die_type (die, cu) != NULL)
return get_die_type (die, cu);
- TYPE_NAME (type) = full_name;
+ type->set_name (full_name);
}
else
{
/* The name is already allocated along with this objfile, so
we don't need to duplicate it for the type. */
- TYPE_NAME (type) = name;
+ type->set_name (name);
}
}
type->set_code (TYPE_CODE_ENUM);
name = dwarf2_full_name (NULL, die, cu);
if (name != NULL)
- TYPE_NAME (type) = name;
+ type->set_name (name);
attr = dwarf2_attr (die, DW_AT_type, cu);
if (attr != NULL)
name = dwarf2_name (die, cu);
if (name)
- TYPE_NAME (type) = name;
+ type->set_name (name);
maybe_set_alignment (cu, die, type);
name = dwarf2_name (die, cu);
if (name)
- TYPE_NAME (range_type) = name;
+ range_type->set_name (name);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr != nullptr)
type = init_type (cu->per_cu->dwarf2_per_objfile->objfile, TYPE_CODE_VOID,0,
NULL);
- TYPE_NAME (type) = dwarf2_name (die, cu);
+ type->set_name (dwarf2_name (die, cu));
/* In Ada, an unspecified type is typically used when the description
of the type is deferred to a different unit. When encountering
with this objfile, so we don't need to
duplicate it for the type. */
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym)) = sym->search_name ();
+ SYMBOL_TYPE (sym)->set_name (sym->search_name ());
}
}
}
/* union sigval */
sigval_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION);
- TYPE_NAME (sigval_type) = xstrdup ("sigval");
+ sigval_type->set_name (xstrdup ("sigval"));
append_composite_type_field (sigval_type, "sival_int", int_type);
append_composite_type_field (sigval_type, "sival_ptr", void_ptr_type);
/* struct siginfo */
siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (siginfo_type) = xstrdup ("siginfo");
+ siginfo_type->set_name (xstrdup ("siginfo"));
append_composite_type_field (siginfo_type, "si_signo", int_type);
append_composite_type_field (siginfo_type, "si_errno", int_type);
append_composite_type_field (siginfo_type, "si_code", int_type);
set_type_code (type, code);
gdb_assert ((bit % TARGET_CHAR_BIT) == 0);
TYPE_LENGTH (type) = bit / TARGET_CHAR_BIT;
- TYPE_NAME (type) = name;
+ type->set_name (name);
return type;
}
t = alloc_type_copy (target_type);
set_type_code (t, TYPE_CODE_COMPLEX);
TYPE_LENGTH (t) = 2 * TYPE_LENGTH (target_type);
- TYPE_NAME (t) = name;
+ t->set_name (name);
TYPE_TARGET_TYPE (t) = target_type;
TYPE_MAIN_TYPE (target_type)->flds_bnds.complex_type = t;
TYPE_OWNER (new_type).gdbarch = get_type_arch (type);
if (TYPE_NAME (type))
- TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type));
+ new_type->set_name (xstrdup (TYPE_NAME (type)));
TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type);
TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
TYPE_LENGTH (type) = bit / TARGET_CHAR_BIT;
if (name)
- TYPE_NAME (type) = gdbarch_obstack_strdup (gdbarch, name);
+ type->set_name (gdbarch_obstack_strdup (gdbarch, name));
return type;
}
gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION);
t = arch_type (gdbarch, code, 0, NULL);
- TYPE_NAME (t) = name;
+ t->set_name (name);
INIT_CPLUS_SPECIFIC (t);
return t;
}
this->main_type->code = code;
}
+ /* Get the name of this type. */
+ const char *name () const
+ {
+ return this->main_type->name;
+ }
+
+ /* Set the name of this type. */
+ void set_name (const char *name)
+ {
+ this->main_type->name = name;
+ }
+
/* * Return the dynamic property of the requested KIND from this type's
list of dynamic properties. */
dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
#define TYPE_INSTANCE_FLAGS(thistype) (thistype)->instance_flags
#define TYPE_MAIN_TYPE(thistype) (thistype)->main_type
-#define TYPE_NAME(thistype) TYPE_MAIN_TYPE(thistype)->name
+#define TYPE_NAME(thistype) ((thistype)->name ())
#define TYPE_TARGET_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->target_type
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
TYPE_NFIELDS (t) = field - field_list;
TYPE_FIELDS (t) = field_list;
- TYPE_NAME (t) = "gdb_gnu_v3_abi_vtable";
+ t->set_name ("gdb_gnu_v3_abi_vtable");
INIT_CPLUS_SPECIFIC (t);
return make_type_with_address_space (t, TYPE_INSTANCE_FLAG_CODE_SPACE);
t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL);
TYPE_NFIELDS (t) = field - field_list;
TYPE_FIELDS (t) = field_list;
- TYPE_NAME (t) = "gdb_gnu_v3_type_info";
+ t->set_name ("gdb_gnu_v3_type_info");
INIT_CPLUS_SPECIFIC (t);
return t;
append_composite_type_field (t, "lbound", bt->builtin_data_ptr);
append_composite_type_field (t, "ubound", bt->builtin_data_ptr);
- TYPE_NAME (t) = "builtin_type_bound128";
+ t->set_name ("builtin_type_bound128");
tdep->i386_bnd_type = t;
}
init_vector_type (bt->builtin_int128, 4));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "builtin_type_vec512i";
+ t->set_name ("builtin_type_vec512i");
tdep->i386_zmm_type = t;
}
init_vector_type (bt->builtin_int128, 2));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "builtin_type_vec256i";
+ t->set_name ("builtin_type_vec256i");
tdep->i386_ymm_type = t;
}
init_vector_type (bt->builtin_int8, 8));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "builtin_type_vec64i";
+ t->set_name ("builtin_type_vec64i");
tdep->i386_mmx_type = t;
}
/* sival_t */
sigval_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION);
- TYPE_NAME (sigval_type) = xstrdup ("sigval_t");
+ sigval_type->set_name (xstrdup ("sigval_t"));
append_composite_type_field (sigval_type, "sival_int", int_type);
append_composite_type_field (sigval_type, "sival_ptr", void_ptr_type);
/* struct siginfo */
siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (siginfo_type) = xstrdup ("siginfo");
+ siginfo_type->set_name (xstrdup ("siginfo"));
append_composite_type_field (siginfo_type, "si_signo", int_type);
append_composite_type_field (siginfo_type, "si_errno", int_type);
append_composite_type_field (siginfo_type, "si_code", int_type);
(.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;
for anything except pointers or functions. */
}
else
- TYPE_NAME (SYMBOL_TYPE (s)) = s->linkage_name ();
+ SYMBOL_TYPE (s)->set_name (s->linkage_name ());
}
break;
/* 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));
}
}
}
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)
struct type *t;
t = alloc_type (mdebugread_objfile);
- TYPE_NAME (t) = name;
+ t->set_name (name);
INIT_CPLUS_SPECIFIC (t);
return t;
}
#define BUILD_OCL_VTYPES(TYPE)\
types[opencl_primitive_type_##TYPE##2] \
= init_vector_type (types[opencl_primitive_type_##TYPE], 2); \
- TYPE_NAME (types[opencl_primitive_type_##TYPE##2]) = OCL_STRING(TYPE ## 2); \
+ types[opencl_primitive_type_##TYPE##2]->set_name (OCL_STRING(TYPE ## 2)); \
types[opencl_primitive_type_##TYPE##3] \
= init_vector_type (types[opencl_primitive_type_##TYPE], 3); \
- TYPE_NAME (types[opencl_primitive_type_##TYPE##3]) = OCL_STRING(TYPE ## 3); \
+ types[opencl_primitive_type_##TYPE##3]->set_name (OCL_STRING(TYPE ## 3)); \
TYPE_LENGTH (types[opencl_primitive_type_##TYPE##3]) \
= 4 * TYPE_LENGTH (types[opencl_primitive_type_##TYPE]); \
types[opencl_primitive_type_##TYPE##4] \
= init_vector_type (types[opencl_primitive_type_##TYPE], 4); \
- TYPE_NAME (types[opencl_primitive_type_##TYPE##4]) = OCL_STRING(TYPE ## 4); \
+ types[opencl_primitive_type_##TYPE##4]->set_name (OCL_STRING(TYPE ## 4)); \
types[opencl_primitive_type_##TYPE##8] \
= init_vector_type (types[opencl_primitive_type_##TYPE], 8); \
- TYPE_NAME (types[opencl_primitive_type_##TYPE##8]) = OCL_STRING(TYPE ## 8); \
+ types[opencl_primitive_type_##TYPE##8]->set_name (OCL_STRING(TYPE ## 8)); \
types[opencl_primitive_type_##TYPE##16] \
= init_vector_type (types[opencl_primitive_type_##TYPE], 16); \
- TYPE_NAME (types[opencl_primitive_type_##TYPE##16]) = OCL_STRING(TYPE ## 16)
+ types[opencl_primitive_type_##TYPE##16]->set_name (OCL_STRING(TYPE ## 16))
types[opencl_primitive_type_char]
= arch_integer_type (gdbarch, 8, 0, "char");
append_composite_type_field (t, "float", bt->builtin_float);
append_composite_type_field (t, "double", bt->builtin_double);
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "builtin_type_fpreg_d";
+ t->set_name ("builtin_type_fpreg_d");
tdep->riscv_fpreg_d_type = t;
}
init_vector_type (bt->builtin_int8, 8));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "ppc_builtin_type_vec64";
+ t->set_name ("ppc_builtin_type_vec64");
tdep->ppc_builtin_type_vec64 = t;
}
init_vector_type (bt->builtin_int8, 16));
TYPE_VECTOR (t) = 1;
- TYPE_NAME (t) = "ppc_builtin_type_vec128";
+ t->set_name ("ppc_builtin_type_vec128");
tdep->ppc_builtin_type_vec128 = t;
}
++nfields;
result->set_code (TYPE_CODE_STRUCT);
- TYPE_NAME (result) = name;
+ result->set_name (name);
TYPE_NFIELDS (result) = nfields;
TYPE_FIELDS (result)
/* Pascal accepts names for pointer types. */
if (get_current_subfile ()->language == language_pascal)
- {
- TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name ();
- }
+ SYMBOL_TYPE (sym)->set_name (sym->linkage_name ());
}
else
- TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name ();
+ SYMBOL_TYPE (sym)->set_name (sym->linkage_name ());
}
add_symbol_to_list (sym, get_file_symbols ());
SYMBOL_VALUE (struct_sym) = valu;
SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
- (char *) NULL);
+ SYMBOL_TYPE (sym)->set_name
+ (obconcat (&objfile->objfile_obstack, sym->linkage_name (),
+ (char *) NULL));
add_symbol_to_list (struct_sym, get_file_symbols ());
}
-
+
break;
case 'T':
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
- (char *) NULL);
+ SYMBOL_TYPE (sym)->set_name
+ (obconcat (&objfile->objfile_obstack, sym->linkage_name (),
+ (char *) NULL));
add_symbol_to_list (sym, get_file_symbols ());
if (synonym)
SYMBOL_VALUE (typedef_sym) = valu;
SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
- TYPE_NAME (SYMBOL_TYPE (sym))
- = obconcat (&objfile->objfile_obstack, sym->linkage_name (),
- (char *) NULL);
+ SYMBOL_TYPE (sym)->set_name
+ (obconcat (&objfile->objfile_obstack, sym->linkage_name (),
+ (char *) NULL));
add_symbol_to_list (typedef_sym, get_file_symbols ());
}
break;
type. */
type = dbx_alloc_type (typenums, objfile);
type->set_code (code);
- TYPE_NAME (type) = type_name;
+ type->set_name (type_name);
INIT_CPLUS_SPECIFIC (type);
TYPE_STUB (type) = 1;
"complete_this_type" function, but never create unnecessary
copies of a type otherwise. */
replace_type (type, xtype);
- TYPE_NAME (type) = NULL;
+ type->set_name (NULL);
}
else
{
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;
}
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)
{
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)
{
/* list entry */
list_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (list_type) = xstrdup ("list");
+ list_type->set_name (xstrdup ("list"));
module_list_ptr_type = void_ptr_type;
/* Structured Exception Handler */
seh_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (seh_type) = xstrdup ("seh");
+ seh_type->set_name (xstrdup ("seh"));
seh_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
/* struct _PEB_LDR_DATA */
peb_ldr_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (peb_ldr_type) = xstrdup ("peb_ldr_data");
+ peb_ldr_type->set_name (xstrdup ("peb_ldr_data"));
append_composite_type_field (peb_ldr_type, "length", dword32_type);
append_composite_type_field (peb_ldr_type, "initialized", dword32_type);
/* struct process environment block */
peb_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (peb_type) = xstrdup ("peb");
+ peb_type->set_name (xstrdup ("peb"));
/* First bytes contain several flags. */
append_composite_type_field (peb_type, "flags", dword_ptr_type);
/* struct thread information block */
tib_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
- TYPE_NAME (tib_type) = xstrdup ("tib");
+ tib_type->set_name (xstrdup ("tib"));
/* uint32_t current_seh; %fs:0x0000 */
append_composite_type_field (tib_type, "current_seh", seh_ptr_type);