diff options
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 6bf3abd..9b2f638 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1456,12 +1456,10 @@ patch_type (struct type *type, struct type *real_type) TYPE_LENGTH (target) = TYPE_LENGTH (real_target); target->set_num_fields (real_target->num_fields ()); - TYPE_FIELDS (target) = (struct field *) TYPE_ALLOC (target, - field_size); - memcpy (TYPE_FIELDS (target), - TYPE_FIELDS (real_target), - field_size); + field *fields = (struct field *) TYPE_ALLOC (target, field_size); + memcpy (fields, real_target->fields (), field_size); + target->set_fields (fields); if (real_target->name ()) { @@ -1882,7 +1880,7 @@ decode_base_type (struct coff_symbol *cs, type->set_name (NULL); INIT_CPLUS_SPECIFIC (type); TYPE_LENGTH (type) = 0; - TYPE_FIELDS (type) = 0; + type->set_fields (nullptr); type->set_num_fields (0); } else @@ -1902,7 +1900,7 @@ decode_base_type (struct coff_symbol *cs, type->set_name (NULL); INIT_CPLUS_SPECIFIC (type); TYPE_LENGTH (type) = 0; - TYPE_FIELDS (type) = 0; + type->set_fields (nullptr); type->set_num_fields (0); } else @@ -1923,7 +1921,7 @@ decode_base_type (struct coff_symbol *cs, type->set_code (TYPE_CODE_ENUM); type->set_name (NULL); TYPE_LENGTH (type) = 0; - TYPE_FIELDS (type) = 0; + type->set_fields (nullptr); type->set_num_fields (0); } else @@ -2041,8 +2039,8 @@ coff_read_struct_type (int index, int length, int lastsym, /* Now create the vector of fields, and record how big it is. */ type->set_num_fields (nfields); - TYPE_FIELDS (type) = (struct field *) - TYPE_ALLOC (type, sizeof (struct field) * nfields); + type->set_fields + ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * nfields)); /* Copy the saved-up fields into the field vector. */ @@ -2121,8 +2119,8 @@ coff_read_enum_type (int index, int length, int lastsym, TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT; type->set_code (TYPE_CODE_ENUM); type->set_num_fields (nsyms); - TYPE_FIELDS (type) = (struct field *) - TYPE_ALLOC (type, sizeof (struct field) * nsyms); + type->set_fields + ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * nsyms)); /* Find the symbols for the values and put them into the type. The symbols can be found in the symlist that we put them on |