Rename to allow_rust_tests
[binutils-gdb.git] / gdb / coffread.c
index 27afa11738d9e32c40af56de4ebcebb1d31ae43d..4950a7324c8a737c12890c09420c482403eef8bf 100644 (file)
@@ -1,5 +1,5 @@
 /* Read coff symbol tables and convert to internal format, for GDB.
-   Copyright (C) 1987-2022 Free Software Foundation, Inc.
+   Copyright (C) 1987-2023 Free Software Foundation, Inc.
    Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
 
    This file is part of GDB.
@@ -1360,7 +1360,7 @@ coff_getfilename (union internal_auxent *aux_entry)
   if (aux_entry->x_file.x_n.x_n.x_zeroes == 0)
     {
       if (strlen (stringtab + aux_entry->x_file.x_n.x_n.x_offset) >= BUFSIZ)
-       internal_error (__FILE__, __LINE__, _("coff file name too long"));
+       internal_error (_("coff file name too long"));
       strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_n.x_offset);
     }
   else
@@ -1472,7 +1472,7 @@ patch_type (struct type *type, struct type *real_type)
   struct type *real_target = real_type->target_type ();
   int field_size = real_target->num_fields () * sizeof (struct field);
 
-  TYPE_LENGTH (target) = TYPE_LENGTH (real_target);
+  target->set_length (real_target->length ());
   target->set_num_fields (real_target->num_fields ());
 
   field *fields = (struct field *) TYPE_ALLOC (target, field_size);
@@ -1509,7 +1509,7 @@ patch_opaque_types (struct symtab *s)
       if (real_sym->aclass () == LOC_TYPEDEF
          && real_sym->domain () == VAR_DOMAIN
          && real_sym->type ()->code () == TYPE_CODE_PTR
-         && TYPE_LENGTH (real_sym->type ()->target_type ()) != 0)
+         && real_sym->type ()->target_type ()->length () != 0)
        {
          const char *name = real_sym->linkage_name ();
          int hash = hashname (name);
@@ -1699,7 +1699,7 @@ process_coff_symbol (struct coff_symbol *cs,
             references work themselves out via the magic of
             coff_lookup_type.  */
          if (sym->type ()->code () == TYPE_CODE_PTR
-             && TYPE_LENGTH (sym->type ()->target_type ()) == 0
+             && sym->type ()->target_type ()->length () == 0
              && sym->type ()->target_type ()->code ()
              != TYPE_CODE_UNDEF)
            {
@@ -1887,7 +1887,7 @@ decode_base_type (struct coff_symbol *cs,
          type->set_code (TYPE_CODE_STRUCT);
          type->set_name (NULL);
          INIT_CPLUS_SPECIFIC (type);
-         TYPE_LENGTH (type) = 0;
+         type->set_length (0);
          type->set_fields (nullptr);
          type->set_num_fields (0);
        }
@@ -1907,7 +1907,7 @@ decode_base_type (struct coff_symbol *cs,
          type = coff_alloc_type (cs->c_symnum);
          type->set_name (NULL);
          INIT_CPLUS_SPECIFIC (type);
-         TYPE_LENGTH (type) = 0;
+         type->set_length (0);
          type->set_fields (nullptr);
          type->set_num_fields (0);
        }
@@ -1928,7 +1928,7 @@ decode_base_type (struct coff_symbol *cs,
          type = coff_alloc_type (cs->c_symnum);
          type->set_code (TYPE_CODE_ENUM);
          type->set_name (NULL);
-         TYPE_LENGTH (type) = 0;
+         type->set_length (0);
          type->set_fields (nullptr);
          type->set_num_fields (0);
        }
@@ -1996,7 +1996,7 @@ coff_read_struct_type (int index, int length, int lastsym,
   type = coff_alloc_type (index);
   type->set_code (TYPE_CODE_STRUCT);
   INIT_CPLUS_SPECIFIC (type);
-  TYPE_LENGTH (type) = length;
+  type->set_length (length);
 
   while (!done && symnum < lastsym && symnum < nlist_nsyms_global)
     {
@@ -2124,9 +2124,9 @@ coff_read_enum_type (int index, int length, int lastsym,
   /* Now fill in the fields of the type-structure.  */
 
   if (length > 0)
-    TYPE_LENGTH (type) = length;
+    type->set_length (length);
   else /* Assume ints.  */
-    TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
+    type->set_length (gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT);
   type->set_code (TYPE_CODE_ENUM);
   type->set_num_fields (nsyms);
   type->set_fields