Remove TYPE_TAG_NAME
[deliverable/binutils-gdb.git] / gdb / dwarf2read.c
index 380ff365bb90dfebec4d0376638f1bda2b6b7a77..b8e681b79a031b32811b46f3144679c06dc1e489 100644 (file)
@@ -147,6 +147,9 @@ struct name_component
 
 struct mapped_index_base
 {
+  mapped_index_base () = default;
+  DISABLE_COPY_AND_ASSIGN (mapped_index_base);
+
   /* The name_component table (a sorted vector).  See name_component's
      description above.  */
   std::vector<name_component> name_components;
@@ -195,10 +198,7 @@ struct mapped_index final : public mapped_index_base
   };
 
   /* Index data format version.  */
-  int version;
-
-  /* The total length of the buffer.  */
-  off_t total_size;
+  int version = 0;
 
   /* The address table data.  */
   gdb::array_view<const gdb_byte> address_table;
@@ -207,7 +207,7 @@ struct mapped_index final : public mapped_index_base
   gdb::array_view<symbol_table_slot> symbol_table;
 
   /* A pointer to the constant pool.  */
-  const char *constant_pool;
+  const char *constant_pool = nullptr;
 
   bool symbol_name_slot_invalid (offset_type idx) const override
   {
@@ -810,49 +810,60 @@ struct dwp_hash_table
 
 struct dwp_file
 {
+  dwp_file (const char *name_, gdb_bfd_ref_ptr &&abfd)
+    : name (name_),
+      dbfd (std::move (abfd))
+  {
+  }
+
   /* Name of the file.  */
   const char *name;
 
   /* File format version.  */
-  int version;
+  int version = 0;
 
   /* The bfd.  */
-  bfd *dbfd;
+  gdb_bfd_ref_ptr dbfd;
 
   /* Section info for this file.  */
-  struct dwp_sections sections;
+  struct dwp_sections sections {};
 
   /* Table of CUs in the file.  */
-  const struct dwp_hash_table *cus;
+  const struct dwp_hash_table *cus = nullptr;
 
   /* Table of TUs in the file.  */
-  const struct dwp_hash_table *tus;
+  const struct dwp_hash_table *tus = nullptr;
 
   /* Tables of loaded CUs/TUs.  Each entry is a struct dwo_unit *.  */
-  htab_t loaded_cus;
-  htab_t loaded_tus;
+  htab_t loaded_cus {};
+  htab_t loaded_tus {};
 
   /* Table to map ELF section numbers to their sections.
      This is only needed for the DWP V1 file format.  */
-  unsigned int num_sections;
-  asection **elf_sections;
+  unsigned int num_sections = 0;
+  asection **elf_sections = nullptr;
 };
 
 /* This represents a '.dwz' file.  */
 
 struct dwz_file
 {
+  dwz_file (gdb_bfd_ref_ptr &&bfd)
+    : dwz_bfd (std::move (bfd))
+  {
+  }
+
   /* A dwz file can only contain a few sections.  */
-  struct dwarf2_section_info abbrev;
-  struct dwarf2_section_info info;
-  struct dwarf2_section_info str;
-  struct dwarf2_section_info line;
-  struct dwarf2_section_info macro;
-  struct dwarf2_section_info gdb_index;
-  struct dwarf2_section_info debug_names;
+  struct dwarf2_section_info abbrev {};
+  struct dwarf2_section_info info {};
+  struct dwarf2_section_info str {};
+  struct dwarf2_section_info line {};
+  struct dwarf2_section_info macro {};
+  struct dwarf2_section_info gdb_index {};
+  struct dwarf2_section_info debug_names {};
 
   /* The dwz's BFD.  */
-  bfd *dwz_bfd;
+  gdb_bfd_ref_ptr dwz_bfd;
 };
 
 /* Struct used to pass misc. parameters to read_die_and_children, et
@@ -1832,7 +1843,7 @@ static void create_all_comp_units (struct dwarf2_per_objfile *dwarf2_per_objfile
 
 static int create_all_type_units (struct dwarf2_per_objfile *dwarf2_per_objfile);
 
-static void load_full_comp_unit (struct dwarf2_per_cu_data *,
+static void load_full_comp_unit (struct dwarf2_per_cu_data *, bool,
                                 enum language);
 
 static void process_full_comp_unit (struct dwarf2_per_cu_data *,
@@ -1932,7 +1943,7 @@ static const gdb_byte *read_and_check_comp_unit_head
 
 static void init_cutu_and_read_dies
   (struct dwarf2_per_cu_data *this_cu, struct abbrev_table *abbrev_table,
-   int use_existing_cu, int keep,
+   int use_existing_cu, int keep, bool skip_partial,
    die_reader_func_ftype *die_reader_func, void *data);
 
 static void init_cutu_and_read_dies_simple
@@ -1986,45 +1997,40 @@ static void free_line_header_voidp (void *arg);
 static void
 dwarf2_statement_list_fits_in_line_number_section_complaint (void)
 {
-  complaint (&symfile_complaints,
-            _("statement list doesn't fit in .debug_line section"));
+  complaint (_("statement list doesn't fit in .debug_line section"));
 }
 
 static void
 dwarf2_debug_line_missing_file_complaint (void)
 {
-  complaint (&symfile_complaints,
-            _(".debug_line section has line data without a file"));
+  complaint (_(".debug_line section has line data without a file"));
 }
 
 static void
 dwarf2_debug_line_missing_end_sequence_complaint (void)
 {
-  complaint (&symfile_complaints,
-            _(".debug_line section has line "
+  complaint (_(".debug_line section has line "
               "program sequence without an end"));
 }
 
 static void
 dwarf2_complex_location_expr_complaint (void)
 {
-  complaint (&symfile_complaints, _("location expression too complex"));
+  complaint (_("location expression too complex"));
 }
 
 static void
 dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
                                              int arg3)
 {
-  complaint (&symfile_complaints,
-            _("const value length mismatch for '%s', got %d, expected %d"),
+  complaint (_("const value length mismatch for '%s', got %d, expected %d"),
             arg1, arg2, arg3);
 }
 
 static void
 dwarf2_section_buffer_overflow_complaint (struct dwarf2_section_info *section)
 {
-  complaint (&symfile_complaints,
-            _("debug info runs off end of %s section"
+  complaint (_("debug info runs off end of %s section"
               " [in module %s]"),
             get_section_name (section),
             get_section_file_name (section));
@@ -2033,8 +2039,7 @@ dwarf2_section_buffer_overflow_complaint (struct dwarf2_section_info *section)
 static void
 dwarf2_macro_malformed_definition_complaint (const char *arg1)
 {
-  complaint (&symfile_complaints,
-            _("macro debug info contains a "
+  complaint (_("macro debug info contains a "
               "malformed macro definition:\n`%s'"),
             arg1);
 }
@@ -2042,8 +2047,7 @@ dwarf2_macro_malformed_definition_complaint (const char *arg1)
 static void
 dwarf2_invalid_attrib_class_complaint (const char *arg1, const char *arg2)
 {
-  complaint (&symfile_complaints,
-            _("invalid attribute class or form for '%s' in '%s'"),
+  complaint (_("invalid attribute class or form for '%s' in '%s'"),
             arg1, arg2);
 }
 
@@ -2147,14 +2151,6 @@ dwarf2_per_objfile::~dwarf2_per_objfile ()
 
   if (dwo_files != NULL)
     free_dwo_files (dwo_files, objfile);
-  if (dwp_file != NULL)
-    gdb_bfd_unref (dwp_file->dbfd);
-
-  if (dwz_file != NULL && dwz_file->dwz_bfd)
-    gdb_bfd_unref (dwz_file->dwz_bfd);
-
-  if (index_table != NULL)
-    index_table->~mapped_index ();
 
   /* Everything else should be on the objfile obstack.  */
 }
@@ -2641,13 +2637,12 @@ static struct dwz_file *
 dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
   const char *filename;
-  struct dwz_file *result;
   bfd_size_type buildid_len_arg;
   size_t buildid_len;
   bfd_byte *buildid;
 
   if (dwarf2_per_objfile->dwz_file != NULL)
-    return dwarf2_per_objfile->dwz_file;
+    return dwarf2_per_objfile->dwz_file.get ();
 
   bfd_set_error (bfd_error_no_error);
   gdb::unique_xmalloc_ptr<char> data
@@ -2693,15 +2688,16 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
     error (_("could not find '.gnu_debugaltlink' file for %s"),
           objfile_name (dwarf2_per_objfile->objfile));
 
-  result = OBSTACK_ZALLOC (&dwarf2_per_objfile->objfile->objfile_obstack,
-                          struct dwz_file);
-  result->dwz_bfd = dwz_bfd.release ();
+  std::unique_ptr<struct dwz_file> result
+    (new struct dwz_file (std::move (dwz_bfd)));
 
-  bfd_map_over_sections (result->dwz_bfd, locate_dwz_sections, result);
+  bfd_map_over_sections (result->dwz_bfd.get (), locate_dwz_sections,
+                        result.get ());
 
-  gdb_bfd_record_inclusion (dwarf2_per_objfile->objfile->obfd, result->dwz_bfd);
-  dwarf2_per_objfile->dwz_file = result;
-  return result;
+  gdb_bfd_record_inclusion (dwarf2_per_objfile->objfile->obfd,
+                           result->dwz_bfd.get ());
+  dwarf2_per_objfile->dwz_file = std::move (result);
+  return dwarf2_per_objfile->dwz_file.get ();
 }
 \f
 /* DWARF quick_symbols_functions support.  */
@@ -2835,12 +2831,12 @@ create_quick_file_names_table (unsigned int nr_initial_entries)
    processing PER_CU->CU.  dw2_setup must have been already called.  */
 
 static void
-load_cu (struct dwarf2_per_cu_data *per_cu)
+load_cu (struct dwarf2_per_cu_data *per_cu, bool skip_partial)
 {
   if (per_cu->is_debug_types)
     load_full_type_unit (per_cu);
   else
-    load_full_comp_unit (per_cu, language_minimal);
+    load_full_comp_unit (per_cu, skip_partial, language_minimal);
 
   if (per_cu->cu == NULL)
     return;  /* Dummy CU.  */
@@ -2851,7 +2847,7 @@ load_cu (struct dwarf2_per_cu_data *per_cu)
 /* Read in the symbols for PER_CU.  */
 
 static void
-dw2_do_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
+dw2_do_instantiate_symtab (struct dwarf2_per_cu_data *per_cu, bool skip_partial)
 {
   struct dwarf2_per_objfile *dwarf2_per_objfile = per_cu->dwarf2_per_objfile;
 
@@ -2870,7 +2866,7 @@ dw2_do_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
       : (per_cu->v.psymtab == NULL || !per_cu->v.psymtab->readin))
     {
       queue_comp_unit (per_cu, language_minimal);
-      load_cu (per_cu);
+      load_cu (per_cu, skip_partial);
 
       /* If we just loaded a CU from a DWO, and we're working with an index
         that may badly handle TUs, load all the TUs in that DWO as well.
@@ -2897,7 +2893,7 @@ dw2_do_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
    table.  */
 
 static struct compunit_symtab *
-dw2_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
+dw2_instantiate_symtab (struct dwarf2_per_cu_data *per_cu, bool skip_partial)
 {
   struct dwarf2_per_objfile *dwarf2_per_objfile = per_cu->dwarf2_per_objfile;
 
@@ -2906,7 +2902,7 @@ dw2_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
     {
       free_cached_comp_units freer (dwarf2_per_objfile);
       scoped_restore decrementer = increment_reading_symtab ();
-      dw2_do_instantiate_symtab (per_cu);
+      dw2_do_instantiate_symtab (per_cu, skip_partial);
       process_cu_includes (dwarf2_per_objfile);
     }
 
@@ -3164,16 +3160,14 @@ create_addrmap_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
 
       if (lo > hi)
        {
-         complaint (&symfile_complaints,
-                    _(".gdb_index address table has invalid range (%s - %s)"),
+         complaint (_(".gdb_index address table has invalid range (%s - %s)"),
                     hex_string (lo), hex_string (hi));
          continue;
        }
 
       if (cu_index >= dwarf2_per_objfile->all_comp_units.size ())
        {
-         complaint (&symfile_complaints,
-                    _(".gdb_index address table has invalid CU number %u"),
+         complaint (_(".gdb_index address table has invalid CU number %u"),
                     (unsigned) cu_index);
          continue;
        }
@@ -3500,7 +3494,6 @@ to use the section anyway."),
     return 0;
 
   map->version = version;
-  map->total_size = section->size;
 
   metadata = (offset_type *) (addr + sizeof (offset_type));
 
@@ -3541,21 +3534,21 @@ to use the section anyway."),
 static int
 dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
-  struct mapped_index local_map, *map;
   const gdb_byte *cu_list, *types_list, *dwz_list = NULL;
   offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0;
   struct dwz_file *dwz;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
 
+  std::unique_ptr<struct mapped_index> map (new struct mapped_index);
   if (!read_index_from_section (objfile, objfile_name (objfile),
                                use_deprecated_index_sections,
-                               &dwarf2_per_objfile->gdb_index, &local_map,
+                               &dwarf2_per_objfile->gdb_index, map.get (),
                                &cu_list, &cu_list_elements,
                                &types_list, &types_list_elements))
     return 0;
 
   /* Don't use the index if it's empty.  */
-  if (local_map.symbol_table.empty ())
+  if (map->symbol_table.empty ())
     return 0;
 
   /* If there is a .dwz file, read it so we can get its CU list as
@@ -3599,13 +3592,9 @@ dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
                                               types_list, types_list_elements);
     }
 
-  create_addrmap_from_index (dwarf2_per_objfile, &local_map);
-
-  map = XOBNEW (&objfile->objfile_obstack, struct mapped_index);
-  map = new (map) mapped_index ();
-  *map = local_map;
+  create_addrmap_from_index (dwarf2_per_objfile, map.get ());
 
-  dwarf2_per_objfile->index_table = map;
+  dwarf2_per_objfile->index_table = std::move (map);
   dwarf2_per_objfile->using_index = 1;
   dwarf2_per_objfile->quick_file_names_table =
     create_quick_file_names_table (dwarf2_per_objfile->all_comp_units.size ());
@@ -3741,7 +3730,7 @@ dw2_find_last_source_symtab (struct objfile *objfile)
   struct dwarf2_per_objfile *dwarf2_per_objfile
     = get_dwarf2_per_objfile (objfile);
   dwarf2_per_cu_data *dwarf_cu = dwarf2_per_objfile->all_comp_units.back ();
-  compunit_symtab *cust = dw2_instantiate_symtab (dwarf_cu);
+  compunit_symtab *cust = dw2_instantiate_symtab (dwarf_cu, false);
 
   if (cust == NULL)
     return NULL;
@@ -3797,7 +3786,7 @@ dw2_map_expand_apply (struct objfile *objfile,
 
   /* This may expand more than one symtab, and we want to iterate over
      all of them.  */
-  dw2_instantiate_symtab (per_cu);
+  dw2_instantiate_symtab (per_cu, false);
 
   return iterate_over_some_symtabs (name, real_path, objfile->compunit_symtabs,
                                    last_made, callback);
@@ -3920,7 +3909,7 @@ dw2_symtab_iter_init (struct dw2_symtab_iterator *iter,
   iter->next = 0;
   iter->global_seen = 0;
 
-  mapped_index *index = dwarf2_per_objfile->index_table;
+  mapped_index *index = dwarf2_per_objfile->index_table.get ();
 
   /* index is NULL if OBJF_READNOW.  */
   if (index != NULL && find_slot_in_mapped_hash (index, name, &iter->vec))
@@ -3961,8 +3950,7 @@ dw2_symtab_iter_next (struct dw2_symtab_iterator *iter)
       if (cu_index >= (dwarf2_per_objfile->all_comp_units.size ()
                       + dwarf2_per_objfile->all_type_units.size ()))
        {
-         complaint (&symfile_complaints,
-                    _(".gdb_index entry has bad CU index"
+         complaint (_(".gdb_index entry has bad CU index"
                       " [in module %s]"),
                     objfile_name (dwarf2_per_objfile->objfile));
          continue;
@@ -4037,7 +4025,7 @@ dw2_lookup_symbol (struct objfile *objfile, int block_index,
   while ((per_cu = dw2_symtab_iter_next (&iter)) != NULL)
     {
       struct symbol *sym, *with_opaque = NULL;
-      struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu);
+      struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
       const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
       struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
 
@@ -4128,7 +4116,7 @@ dw2_expand_symtabs_for_function (struct objfile *objfile,
                        func_name);
 
   while ((per_cu = dw2_symtab_iter_next (&iter)) != NULL)
-    dw2_instantiate_symtab (per_cu);
+    dw2_instantiate_symtab (per_cu, false);
 
 }
 
@@ -4144,7 +4132,12 @@ dw2_expand_all_symtabs (struct objfile *objfile)
     {
       dwarf2_per_cu_data *per_cu = dwarf2_per_objfile->get_cutu (i);
 
-      dw2_instantiate_symtab (per_cu);
+      /* We don't want to directly expand a partial CU, because if we
+        read it with the wrong language, then assertion failures can
+        be triggered later on.  See PR symtab/23010.  So, tell
+        dw2_instantiate_symtab to skip partial CUs -- any important
+        partial CU will be read via DW_TAG_imported_unit anyway.  */
+      dw2_instantiate_symtab (per_cu, true);
     }
 }
 
@@ -4176,7 +4169,7 @@ dw2_expand_symtabs_with_fullname (struct objfile *objfile,
 
          if (filename_cmp (this_fullname, fullname) == 0)
            {
-             dw2_instantiate_symtab (per_cu);
+             dw2_instantiate_symtab (per_cu, false);
              break;
            }
        }
@@ -5000,7 +4993,7 @@ dw2_expand_symtabs_matching_one
       bool symtab_was_null
        = (per_cu->v.quick->compunit_symtab == NULL);
 
-      dw2_instantiate_symtab (per_cu);
+      dw2_instantiate_symtab (per_cu, false);
 
       if (expansion_notify != NULL
          && symtab_was_null
@@ -5078,8 +5071,7 @@ dw2_expand_marked_cus
       if (cu_index >= (dwarf2_per_objfile->all_comp_units.size ()
                       + dwarf2_per_objfile->all_type_units.size ()))
        {
-         complaint (&symfile_complaints,
-                    _(".gdb_index entry has bad CU index"
+         complaint (_(".gdb_index entry has bad CU index"
                       " [in module %s]"),
                       objfile_name (dwarf2_per_objfile->objfile));
          continue;
@@ -5250,7 +5242,8 @@ dw2_find_pc_sect_compunit_symtab (struct objfile *objfile,
             paddress (get_objfile_arch (objfile), pc));
 
   result
-    = recursively_find_pc_sect_compunit_symtab (dw2_instantiate_symtab (data),
+    = recursively_find_pc_sect_compunit_symtab (dw2_instantiate_symtab (data,
+                                                                       false),
                                                pc);
   gdb_assert (result != NULL);
   return result;
@@ -5602,17 +5595,18 @@ create_cus_from_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
 static bool
 dwarf2_read_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
-  mapped_debug_names local_map (dwarf2_per_objfile);
+  std::unique_ptr<mapped_debug_names> map
+    (new mapped_debug_names (dwarf2_per_objfile));
   mapped_debug_names dwz_map (dwarf2_per_objfile);
   struct objfile *objfile = dwarf2_per_objfile->objfile;
 
   if (!read_debug_names_from_section (objfile, objfile_name (objfile),
                                      &dwarf2_per_objfile->debug_names,
-                                     local_map))
+                                     *map))
     return false;
 
   /* Don't use the index if it's empty.  */
-  if (local_map.name_count == 0)
+  if (map->name_count == 0)
     return false;
 
   /* If there is a .dwz file, read it so we can get its CU list as
@@ -5630,9 +5624,9 @@ dwarf2_read_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile)
        }
     }
 
-  create_cus_from_debug_names (dwarf2_per_objfile, local_map, dwz_map);
+  create_cus_from_debug_names (dwarf2_per_objfile, *map, dwz_map);
 
-  if (local_map.tu_count != 0)
+  if (map->tu_count != 0)
     {
       /* We can only handle a single .debug_types when we have an
         index.  */
@@ -5643,15 +5637,13 @@ dwarf2_read_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile)
                                                dwarf2_per_objfile->types, 0);
 
       create_signatured_type_table_from_debug_names
-       (dwarf2_per_objfile, local_map, section, &dwarf2_per_objfile->abbrev);
+       (dwarf2_per_objfile, *map, section, &dwarf2_per_objfile->abbrev);
     }
 
   create_addrmap_from_aranges (dwarf2_per_objfile,
                               &dwarf2_per_objfile->debug_aranges);
 
-  dwarf2_per_objfile->debug_names_table.reset
-    (new mapped_debug_names (dwarf2_per_objfile));
-  *dwarf2_per_objfile->debug_names_table = std::move (local_map);
+  dwarf2_per_objfile->debug_names_table = std::move (map);
   dwarf2_per_objfile->using_index = 1;
   dwarf2_per_objfile->quick_file_names_table =
     create_quick_file_names_table (dwarf2_per_objfile->all_comp_units.size ());
@@ -5766,8 +5758,7 @@ dw2_debug_names_iterator::find_vec_in_debug_names
   --namei;
   if (namei >= map.name_count)
     {
-      complaint (&symfile_complaints,
-                _("Wrong .debug_names with name index %u but name_count=%u "
+      complaint (_("Wrong .debug_names with name index %u but name_count=%u "
                   "[in module %s]"),
                 namei, map.name_count,
                 objfile_name (map.dwarf2_per_objfile->objfile));
@@ -5790,8 +5781,7 @@ dw2_debug_names_iterator::find_vec_in_debug_names
 #if 0 /* An expensive sanity check.  */
          if (namei_full_hash != dwarf5_djb_hash (namei_string))
            {
-             complaint (&symfile_complaints,
-                        _("Wrong .debug_names hash for string at index %u "
+             complaint (_("Wrong .debug_names hash for string at index %u "
                           "[in module %s]"),
                         namei, objfile_name (dwarf2_per_objfile->objfile));
              return NULL;
@@ -5820,8 +5810,7 @@ dw2_debug_names_iterator::find_vec_in_debug_names
 {
   if (namei >= map.name_count)
     {
-      complaint (&symfile_complaints,
-                _("Wrong .debug_names with name index %u but name_count=%u "
+      complaint (_("Wrong .debug_names with name index %u but name_count=%u "
                   "[in module %s]"),
                 namei, map.name_count,
                 objfile_name (map.dwarf2_per_objfile->objfile));
@@ -5858,8 +5847,7 @@ dw2_debug_names_iterator::next ()
   const auto indexval_it = m_map.abbrev_map.find (abbrev);
   if (indexval_it == m_map.abbrev_map.cend ())
     {
-      complaint (&symfile_complaints,
-                _("Wrong .debug_names undefined abbrev code %s "
+      complaint (_("Wrong .debug_names undefined abbrev code %s "
                   "[in module %s]"),
                 pulongest (abbrev), objfile_name (objfile));
       return NULL;
@@ -5884,8 +5872,7 @@ dw2_debug_names_iterator::next ()
          m_addr += bytes_read;
          break;
        default:
-         complaint (&symfile_complaints,
-                    _("Unsupported .debug_names form %s [in module %s]"),
+         complaint (_("Unsupported .debug_names form %s [in module %s]"),
                     dwarf_form_name (attr.form),
                     objfile_name (objfile));
          return NULL;
@@ -5896,8 +5883,7 @@ dw2_debug_names_iterator::next ()
          /* Don't crash on bad data.  */
          if (ull >= dwarf2_per_objfile->all_comp_units.size ())
            {
-             complaint (&symfile_complaints,
-                        _(".debug_names entry has bad CU index %s"
+             complaint (_(".debug_names entry has bad CU index %s"
                           " [in module %s]"),
                         pulongest (ull),
                         objfile_name (dwarf2_per_objfile->objfile));
@@ -5909,8 +5895,7 @@ dw2_debug_names_iterator::next ()
          /* Don't crash on bad data.  */
          if (ull >= dwarf2_per_objfile->all_type_units.size ())
            {
-             complaint (&symfile_complaints,
-                        _(".debug_names entry has bad TU index %s"
+             complaint (_(".debug_names entry has bad TU index %s"
                           " [in module %s]"),
                         pulongest (ull),
                         objfile_name (dwarf2_per_objfile->objfile));
@@ -6049,7 +6034,7 @@ dw2_debug_names_lookup_symbol (struct objfile *objfile, int block_index_int,
   while ((per_cu = iter.next ()) != NULL)
     {
       struct symbol *sym, *with_opaque = NULL;
-      struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu);
+      struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
       const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
       struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
 
@@ -6111,7 +6096,7 @@ dw2_debug_names_expand_symtabs_for_function (struct objfile *objfile,
 
       struct dwarf2_per_cu_data *per_cu;
       while ((per_cu = iter.next ()) != NULL)
-       dw2_instantiate_symtab (per_cu);
+       dw2_instantiate_symtab (per_cu, false);
     }
 }
 
@@ -6739,8 +6724,7 @@ create_debug_type_hash_table (struct dwarf2_per_objfile *dwarf2_per_objfile,
              dup_sect_off = dup_tu->per_cu.sect_off;
            }
 
-         complaint (&symfile_complaints,
-                    _("debug type entry at offset %s is duplicate to"
+         complaint (_("debug type entry at offset %s is duplicate to"
                       " the entry at offset %s, signature %s"),
                     sect_offset_str (sect_off), sect_offset_str (dup_sect_off),
                     hex_string (header.signature));
@@ -7410,6 +7394,7 @@ static void
 init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu,
                         struct abbrev_table *abbrev_table,
                         int use_existing_cu, int keep,
+                        bool skip_partial,
                         die_reader_func_ftype *die_reader_func,
                         void *data)
 {
@@ -7548,6 +7533,9 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu,
   init_cu_die_reader (&reader, cu, section, NULL, abbrev_table);
   info_ptr = read_full_die (&reader, &comp_unit_die, info_ptr, &has_children);
 
+  if (skip_partial && comp_unit_die->tag == DW_TAG_partial_unit)
+    return;
+
   /* If we are in a DWO stub, process it and then read in the "real" CU/TU
      from the DWO file.  read_cutu_die_from_dwo will allocate the abbreviation
      table from the DWO file and pass the ownership over to us.  It will be
@@ -7565,8 +7553,7 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu,
 
       if (has_children)
        {
-         complaint (&symfile_complaints,
-                    _("compilation unit with DW_AT_GNU_dwo_name"
+         complaint (_("compilation unit with DW_AT_GNU_dwo_name"
                       " has children (offset %s) [in module %s]"),
                     sect_offset_str (this_cu->sect_off),
                     bfd_get_filename (abfd));
@@ -8042,14 +8029,14 @@ process_psymtab_comp_unit (struct dwarf2_per_cu_data *this_cu,
     free_one_cached_comp_unit (this_cu);
 
   if (this_cu->is_debug_types)
-    init_cutu_and_read_dies (this_cu, NULL, 0, 0, build_type_psymtabs_reader,
-                            NULL);
+    init_cutu_and_read_dies (this_cu, NULL, 0, 0, false,
+                            build_type_psymtabs_reader, NULL);
   else
     {
       process_psymtab_comp_unit_data info;
       info.want_partial_unit = want_partial_unit;
       info.pretend_language = pretend_language;
-      init_cutu_and_read_dies (this_cu, NULL, 0, 0,
+      init_cutu_and_read_dies (this_cu, NULL, 0, 0, false,
                               process_psymtab_comp_unit_reader, &info);
     }
 
@@ -8209,7 +8196,7 @@ build_type_psymtabs_1 (struct dwarf2_per_objfile *dwarf2_per_objfile)
        }
 
       init_cutu_and_read_dies (&tu.sig_type->per_cu, abbrev_table.get (),
-                              0, 0, build_type_psymtabs_reader, NULL);
+                              0, 0, false, build_type_psymtabs_reader, NULL);
     }
 }
 
@@ -8316,7 +8303,7 @@ process_skeletonless_type_unit (void **slot, void *info)
   *slot = entry;
 
   /* This does the job that build_type_psymtabs_1 would have done.  */
-  init_cutu_and_read_dies (&entry->per_cu, NULL, 0, 0,
+  init_cutu_and_read_dies (&entry->per_cu, NULL, 0, 0, false,
                           build_type_psymtabs_reader, NULL);
 
   return 1;
@@ -8464,7 +8451,7 @@ load_partial_comp_unit_reader (const struct die_reader_specs *reader,
 static void
 load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu)
 {
-  init_cutu_and_read_dies (this_cu, NULL, 1, 1,
+  init_cutu_and_read_dies (this_cu, NULL, 1, 1, false,
                           load_partial_comp_unit_reader, NULL);
 }
 
@@ -8740,8 +8727,7 @@ partial_die_parent_scope (struct partial_die_info *pdi,
       /* FIXME drow/2004-04-01: What should we be doing with
         function-local names?  For partial symbols, we should probably be
         ignoring them.  */
-      complaint (&symfile_complaints,
-                _("unhandled containing DIE tag %d for DIE at %s"),
+      complaint (_("unhandled containing DIE tag %d for DIE at %s"),
                 parent->tag, sect_offset_str (pdi->sect_off));
       parent->scope = grandparent_scope;
     }
@@ -9099,7 +9085,7 @@ add_partial_enumeration (struct partial_die_info *enum_pdi,
   while (pdi)
     {
       if (pdi->tag != DW_TAG_enumerator || pdi->name == NULL)
-       complaint (&symfile_complaints, _("malformed enumerator DIE ignored"));
+       complaint (_("malformed enumerator DIE ignored"));
       else
        add_partial_symbol (pdi, cu);
       pdi = pdi->die_sibling;
@@ -9191,16 +9177,14 @@ skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
        {
          read_attribute (reader, &attr, &abbrev->attrs[i], info_ptr);
          if (attr.form == DW_FORM_ref_addr)
-           complaint (&symfile_complaints,
-                      _("ignoring absolute DW_AT_sibling"));
+           complaint (_("ignoring absolute DW_AT_sibling"));
          else
            {
              sect_offset off = dwarf2_get_ref_die_offset (&attr);
              const gdb_byte *sibling_ptr = buffer + to_underlying (off);
 
              if (sibling_ptr < info_ptr)
-               complaint (&symfile_complaints,
-                          _("DW_AT_sibling points backwards"));
+               complaint (_("DW_AT_sibling points backwards"));
              else if (sibling_ptr > reader->buffer_end)
                dwarf2_section_buffer_overflow_complaint (reader->die_section);
              else
@@ -9558,7 +9542,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
       return;
     }
 
-  dw2_do_instantiate_symtab (per_cu);
+  dw2_do_instantiate_symtab (per_cu, false);
 }
 
 /* Trivial hash function for die_info: the hash value of a DIE
@@ -9627,11 +9611,12 @@ load_full_comp_unit_reader (const struct die_reader_specs *reader,
 
 static void
 load_full_comp_unit (struct dwarf2_per_cu_data *this_cu,
+                    bool skip_partial,
                     enum language pretend_language)
 {
   gdb_assert (! this_cu->is_debug_types);
 
-  init_cutu_and_read_dies (this_cu, NULL, 1, 1,
+  init_cutu_and_read_dies (this_cu, NULL, 1, 1, skip_partial,
                           load_full_comp_unit_reader, &pretend_language);
 }
 
@@ -9682,7 +9667,7 @@ compute_delayed_physnames (struct dwarf2_cu *cu)
     return;
   gdb_assert (cu->language == language_cplus);
 
-  for (struct delayed_method_info &mi : cu->method_list)
+  for (const delayed_method_info &mi : cu->method_list)
     {
       const char *physname;
       struct fn_fieldlist *fn_flp
@@ -9754,8 +9739,7 @@ fixup_go_packaging (struct dwarf2_cu *cu)
                  struct objfile *objfile
                    = cu->per_cu->dwarf2_per_objfile->objfile;
                  if (strcmp (package_name, this_package_name) != 0)
-                   complaint (&symfile_complaints,
-                              _("Symtab %s has objects from two different Go packages: %s and %s"),
+                   complaint (_("Symtab %s has objects from two different Go packages: %s and %s"),
                               (symbol_symtab (sym) != NULL
                                ? symtab_to_filename_for_display
                                    (symbol_symtab (sym))
@@ -9778,8 +9762,6 @@ fixup_go_packaging (struct dwarf2_cu *cu)
                                     saved_package_name);
       struct symbol *sym;
 
-      TYPE_TAG_NAME (type) = TYPE_NAME (type);
-
       sym = allocate_symbol (objfile);
       SYMBOL_SET_LANGUAGE (sym, language_go, &objfile->objfile_obstack);
       SYMBOL_SET_NAMES (sym, saved_package_name,
@@ -9887,8 +9869,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
              || (TYPE_FIELD_LOC_KIND (field_type, index)
                  != FIELD_LOC_KIND_BITPOS))
            {
-             complaint (&symfile_complaints,
-                        _("Could not parse Rust enum encoding string \"%s\""
+             complaint (_("Could not parse Rust enum encoding string \"%s\""
                           "[in module %s]"),
                         TYPE_FIELD_NAME (type, 0),
                         objfile_name (objfile));
@@ -10103,8 +10084,10 @@ static void
 rust_union_quirks (struct dwarf2_cu *cu)
 {
   gdb_assert (cu->language == language_rust);
-  for (struct type *type : cu->rust_unions)
-    quirk_rust_enum (type, cu->per_cu->dwarf2_per_objfile->objfile);
+  for (type *type_ : cu->rust_unions)
+    quirk_rust_enum (type_, cu->per_cu->dwarf2_per_objfile->objfile);
+  /* We don't need this any more.  */
+  cu->rust_unions.clear ();
 }
 
 /* Return the symtab for PER_CU.  This works properly regardless of
@@ -10461,7 +10444,7 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
 
       /* If necessary, add it to the queue and load its DIEs.  */
       if (maybe_queue_comp_unit (cu, per_cu, cu->language))
-       load_full_comp_unit (per_cu, cu->language);
+       load_full_comp_unit (per_cu, false, cu->language);
 
       VEC_safe_push (dwarf2_per_cu_ptr, cu->per_cu->imported_symtabs,
                     per_cu);
@@ -10578,12 +10561,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
       cu->processing_has_namespace_info = 1;
       if (read_namespace_alias (die, cu))
        break;
-      /* The declaration is not a global namespace alias: fall through.  */
+      /* The declaration is not a global namespace alias.  */
+      /* Fall through.  */
     case DW_TAG_imported_module:
       cu->processing_has_namespace_info = 1;
       if (die->child != NULL && (die->tag == DW_TAG_imported_declaration
                                 || cu->language != language_fortran))
-       complaint (&symfile_complaints, _("Tag '%s' has unexpected children"),
+       complaint (_("Tag '%s' has unexpected children"),
                   dwarf_tag_name (die->tag));
       read_import_statement (die, cu);
       break;
@@ -10817,8 +10801,7 @@ dwarf2_compute_name (const char *name,
                  attr = dwarf2_attr (child, DW_AT_type, cu);
                  if (attr == NULL)
                    {
-                     complaint (&symfile_complaints,
-                                _("template parameter missing DW_AT_type"));
+                     complaint (_("template parameter missing DW_AT_type"));
                      buf.puts ("UNKNOWN_TYPE");
                      continue;
                    }
@@ -10826,15 +10809,15 @@ dwarf2_compute_name (const char *name,
 
                  if (child->tag == DW_TAG_template_type_param)
                    {
-                     c_print_type (type, "", &buf, -1, 0, &type_print_raw_options);
+                     c_print_type (type, "", &buf, -1, 0, cu->language,
+                                   &type_print_raw_options);
                      continue;
                    }
 
                  attr = dwarf2_attr (child, DW_AT_const_value, cu);
                  if (attr == NULL)
                    {
-                     complaint (&symfile_complaints,
-                                _("template parameter missing "
+                     complaint (_("template parameter missing "
                                   "DW_AT_const_value"));
                      buf.puts ("UNKNOWN_VALUE");
                      continue;
@@ -11028,8 +11011,7 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
             compute DW_AT_linkage_name incorrectly.  But in such case
             GDB would need to be bug-to-bug compatible.  */
 
-         complaint (&symfile_complaints,
-                    _("Computed physname <%s> does not match demangled <%s> "
+         complaint (_("Computed physname <%s> does not match demangled <%s> "
                       "(from linkage <%s>) - DIE at %s [in module %s]"),
                     physname, canon, mangled, sect_offset_str (die->sect_off),
                     objfile_name (objfile));
@@ -11092,8 +11074,7 @@ read_namespace_alias (struct die_info *die, struct dwarf2_cu *cu)
 
       if (num == MAX_NESTED_IMPORTED_DECLARATIONS)
        {
-         complaint (&symfile_complaints,
-                    _("DIE at %s has too many recursively imported "
+         complaint (_("DIE at %s has too many recursively imported "
                       "declarations"), sect_offset_str (d->sect_off));
          return 0;
        }
@@ -11155,7 +11136,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
   import_attr = dwarf2_attr (die, DW_AT_import, cu);
   if (import_attr == NULL)
     {
-      complaint (&symfile_complaints, _("Tag '%s' has no DW_AT_import"),
+      complaint (_("Tag '%s' has no DW_AT_import"),
                 dwarf_tag_name (die->tag));
       return;
     }
@@ -11235,8 +11216,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
 
        if (child_die->tag != DW_TAG_imported_declaration)
          {
-           complaint (&symfile_complaints,
-                      _("child DW_TAG_imported_declaration expected "
+           complaint (_("child DW_TAG_imported_declaration expected "
                         "- DIE at %s [in module %s]"),
                       sect_offset_str (child_die->sect_off),
                       objfile_name (objfile));
@@ -11246,7 +11226,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
        import_attr = dwarf2_attr (child_die, DW_AT_import, cu);
        if (import_attr == NULL)
          {
-           complaint (&symfile_complaints, _("Tag '%s' has no DW_AT_import"),
+           complaint (_("Tag '%s' has no DW_AT_import"),
                       dwarf_tag_name (child_die->tag));
            continue;
          }
@@ -11257,8 +11237,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
        imported_name = dwarf2_name (imported_die, imported_cu);
        if (imported_name == NULL)
          {
-           complaint (&symfile_complaints,
-                      _("child DW_TAG_imported_declaration has unknown "
+           complaint (_("child DW_TAG_imported_declaration has unknown "
                         "imported name - DIE at %s [in module %s]"),
                       sect_offset_str (child_die->sect_off),
                       objfile_name (objfile));
@@ -11511,8 +11490,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
   if (attr && cu->line_header)
     {
       if (dwarf2_attr (die, DW_AT_macro_info, cu))
-       complaint (&symfile_complaints,
-                  _("CU refers to both DW_AT_macros and DW_AT_macro_info"));
+       complaint (_("CU refers to both DW_AT_macros and DW_AT_macro_info"));
 
       dwarf_decode_macros (cu, DW_UNSND (attr), 1);
     }
@@ -11802,8 +11780,7 @@ create_dwo_cu_reader (const struct die_reader_specs *reader,
   attr = dwarf2_attr (comp_unit_die, DW_AT_GNU_dwo_id, cu);
   if (attr == NULL)
     {
-      complaint (&symfile_complaints,
-                _("Dwarf Error: debug entry at offset %s is missing"
+      complaint (_("Dwarf Error: debug entry at offset %s is missing"
                   " its dwo_id [in module %s]"),
                 sect_offset_str (sect_off), dwo_file->dwo_name);
       return;
@@ -11883,8 +11860,7 @@ create_cus_hash_table (struct dwarf2_per_objfile *dwarf2_per_objfile,
          const struct dwo_unit *dup_cu = (const struct dwo_unit *)*slot;
          sect_offset dup_sect_off = dup_cu->sect_off;
 
-         complaint (&symfile_complaints,
-                    _("debug cu entry at offset %s is duplicate to"
+         complaint (_("debug cu entry at offset %s is duplicate to"
                       " the entry at offset %s, signature %s"),
                     sect_offset_str (sect_off), sect_offset_str (dup_sect_off),
                     hex_string (dwo_unit->signature));
@@ -12035,7 +12011,7 @@ create_dwp_hash_table (struct dwarf2_per_objfile *dwarf2_per_objfile,
                       struct dwp_file *dwp_file, int is_debug_types)
 {
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  bfd *dbfd = dwp_file->dbfd;
+  bfd *dbfd = dwp_file->dbfd.get ();
   const gdb_byte *index_ptr, *index_end;
   struct dwarf2_section_info *index;
   uint32_t version, nr_columns, nr_units, nr_slots;
@@ -12094,8 +12070,7 @@ create_dwp_hash_table (struct dwarf2_per_objfile *dwarf2_per_objfile,
       if (nr_slots != 0 || nr_units != 0
          || (version == 2 && nr_columns != 0))
        {
-         complaint (&symfile_complaints,
-                    _("Empty DWP but nr_slots,nr_units,nr_columns not"
+         complaint (_("Empty DWP but nr_slots,nr_units,nr_columns not"
                       " all zero [in modules %s]"),
                     dwp_file->name);
        }
@@ -12278,7 +12253,7 @@ create_dwo_unit_in_dwp_v1 (struct dwarf2_per_objfile *dwarf2_per_objfile,
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   const struct dwp_hash_table *dwp_htab =
     is_debug_types ? dwp_file->tus : dwp_file->cus;
-  bfd *dbfd = dwp_file->dbfd;
+  bfd *dbfd = dwp_file->dbfd.get ();
   const char *kind = is_debug_types ? "TU" : "CU";
   struct dwo_file *dwo_file;
   struct dwo_unit *dwo_unit;
@@ -12480,7 +12455,7 @@ create_dwo_unit_in_dwp_v2 (struct dwarf2_per_objfile *dwarf2_per_objfile,
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   const struct dwp_hash_table *dwp_htab =
     is_debug_types ? dwp_file->tus : dwp_file->cus;
-  bfd *dbfd = dwp_file->dbfd;
+  bfd *dbfd = dwp_file->dbfd.get ();
   const char *kind = is_debug_types ? "TU" : "CU";
   struct dwo_file *dwo_file;
   struct dwo_unit *dwo_unit;
@@ -12650,7 +12625,7 @@ lookup_dwo_unit_in_dwp (struct dwarf2_per_objfile *dwarf2_per_objfile,
 {
   const struct dwp_hash_table *dwp_htab =
     is_debug_types ? dwp_file->tus : dwp_file->cus;
-  bfd *dbfd = dwp_file->dbfd;
+  bfd *dbfd = dwp_file->dbfd.get ();
   uint32_t mask = dwp_htab->nr_slots - 1;
   uint32_t hash = signature & mask;
   uint32_t hash2 = ((signature >> 32) & mask) | 1;
@@ -13092,11 +13067,10 @@ open_dwp_file (struct dwarf2_per_objfile *dwarf2_per_objfile,
    By convention the name of the DWP file is ${objfile}.dwp.
    The result is NULL if it can't be found.  */
 
-static struct dwp_file *
+static std::unique_ptr<struct dwp_file>
 open_and_init_dwp_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
   struct objfile *objfile = dwarf2_per_objfile->objfile;
-  struct dwp_file *dwp_file;
 
   /* Try to find first .dwp for the binary file before any symbolic links
      resolving.  */
@@ -13130,11 +13104,12 @@ open_and_init_dwp_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
     {
       if (dwarf_read_debug)
        fprintf_unfiltered (gdb_stdlog, "DWP file not found: %s\n", dwp_name.c_str ());
-      return NULL;
+      return std::unique_ptr<dwp_file> ();
     }
-  dwp_file = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwp_file);
-  dwp_file->name = bfd_get_filename (dbfd.get ());
-  dwp_file->dbfd = dbfd.release ();
+
+  const char *name = bfd_get_filename (dbfd.get ());
+  std::unique_ptr<struct dwp_file> dwp_file
+    (new struct dwp_file (name, std::move (dbfd)));
 
   /* +1: section 0 is unused */
   dwp_file->num_sections = bfd_count_sections (dwp_file->dbfd) + 1;
@@ -13142,12 +13117,15 @@ open_and_init_dwp_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
     OBSTACK_CALLOC (&objfile->objfile_obstack,
                    dwp_file->num_sections, asection *);
 
-  bfd_map_over_sections (dwp_file->dbfd, dwarf2_locate_common_dwp_sections,
-                        dwp_file);
+  bfd_map_over_sections (dwp_file->dbfd.get (),
+                        dwarf2_locate_common_dwp_sections,
+                        dwp_file.get ());
 
-  dwp_file->cus = create_dwp_hash_table (dwarf2_per_objfile, dwp_file, 0);
+  dwp_file->cus = create_dwp_hash_table (dwarf2_per_objfile, dwp_file.get (),
+                                        0);
 
-  dwp_file->tus = create_dwp_hash_table (dwarf2_per_objfile, dwp_file, 1);
+  dwp_file->tus = create_dwp_hash_table (dwarf2_per_objfile, dwp_file.get (),
+                                        1);
 
   /* The DWP file version is stored in the hash table.  Oh well.  */
   if (dwp_file->cus && dwp_file->tus
@@ -13170,8 +13148,9 @@ open_and_init_dwp_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
     dwp_file->version = 2;
 
   if (dwp_file->version == 2)
-    bfd_map_over_sections (dwp_file->dbfd, dwarf2_locate_v2_dwp_sections,
-                          dwp_file);
+    bfd_map_over_sections (dwp_file->dbfd.get (),
+                          dwarf2_locate_v2_dwp_sections,
+                          dwp_file.get ());
 
   dwp_file->loaded_cus = allocate_dwp_loaded_cutus_table (objfile);
   dwp_file->loaded_tus = allocate_dwp_loaded_cutus_table (objfile);
@@ -13199,7 +13178,7 @@ get_dwp_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
        = open_and_init_dwp_file (dwarf2_per_objfile);
       dwarf2_per_objfile->dwp_checked = 1;
     }
-  return dwarf2_per_objfile->dwp_file;
+  return dwarf2_per_objfile->dwp_file.get ();
 }
 
 /* Subroutine of lookup_dwo_comp_unit, lookup_dwo_type_unit.
@@ -13481,8 +13460,7 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
   if (die->tag != origin_die->tag
       && !(die->tag == DW_TAG_inlined_subroutine
           && origin_die->tag == DW_TAG_subprogram))
-    complaint (&symfile_complaints,
-              _("DIE %s and its abstract origin %s have different tags"),
+    complaint (_("DIE %s and its abstract origin %s have different tags"),
               sect_offset_str (die->sect_off),
               sect_offset_str (origin_die->sect_off));
 
@@ -13528,14 +13506,12 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
          if (child_die->tag != child_origin_die->tag
              && !(child_die->tag == DW_TAG_inlined_subroutine
                   && child_origin_die->tag == DW_TAG_subprogram))
-           complaint (&symfile_complaints,
-                      _("Child DIE %s and its abstract origin %s have "
+           complaint (_("Child DIE %s and its abstract origin %s have "
                         "different tags"),
                       sect_offset_str (child_die->sect_off),
                       sect_offset_str (child_origin_die->sect_off));
          if (child_origin_die->parent != origin_die)
-           complaint (&symfile_complaints,
-                      _("Child DIE %s and its abstract origin %s have "
+           complaint (_("Child DIE %s and its abstract origin %s have "
                         "different parents"),
                       sect_offset_str (child_die->sect_off),
                       sect_offset_str (child_origin_die->sect_off));
@@ -13547,8 +13523,7 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
   sect_offset *offsets_end = offsets.data () + offsets.size ();
   for (offsetp = offsets.data () + 1; offsetp < offsets_end; offsetp++)
     if (offsetp[-1] == *offsetp)
-      complaint (&symfile_complaints,
-                _("Multiple children of DIE %s refer "
+      complaint (_("Multiple children of DIE %s refer "
                   "to DIE %s as their abstract origin"),
                 sect_offset_str (die->sect_off), sect_offset_str (*offsetp));
 
@@ -13614,8 +13589,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
      illegal according to the DWARF standard.  */
   if (name == NULL)
     {
-      complaint (&symfile_complaints,
-                _("missing name for subprogram DIE at %s"),
+      complaint (_("missing name for subprogram DIE at %s"),
                 sect_offset_str (die->sect_off));
       return;
     }
@@ -13626,8 +13600,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
     {
       attr = dwarf2_attr (die, DW_AT_external, cu);
       if (!attr || !DW_UNSND (attr))
-       complaint (&symfile_complaints,
-                  _("cannot get low and high bounds "
+       complaint (_("cannot get low and high bounds "
                     "for subprogram DIE at %s"),
                   sect_offset_str (die->sect_off));
       return;
@@ -13860,8 +13833,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
     }
   if (!attr)
     {
-      complaint (&symfile_complaints,
-                _("missing DW_AT_call_return_pc for DW_TAG_call_site "
+      complaint (_("missing DW_AT_call_return_pc for DW_TAG_call_site "
                   "DIE %s [in module %s]"),
                 sect_offset_str (die->sect_off), objfile_name (objfile));
       return;
@@ -13877,8 +13849,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
   slot = htab_find_slot (cu->call_site_htab, &call_site_local, INSERT);
   if (*slot != NULL)
     {
-      complaint (&symfile_complaints,
-                _("Duplicate PC %s for DW_TAG_call_site "
+      complaint (_("Duplicate PC %s for DW_TAG_call_site "
                   "DIE %s [in module %s]"),
                 paddress (gdbarch, pc), sect_offset_str (die->sect_off),
                 objfile_name (objfile));
@@ -13894,8 +13865,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
       if (child_die->tag != DW_TAG_call_site_parameter
           && child_die->tag != DW_TAG_GNU_call_site_parameter)
        {
-         complaint (&symfile_complaints,
-                    _("Tag %d is not DW_TAG_call_site_parameter in "
+         complaint (_("Tag %d is not DW_TAG_call_site_parameter in "
                       "DW_TAG_call_site child DIE %s [in module %s]"),
                     child_die->tag, sect_offset_str (child_die->sect_off),
                     objfile_name (objfile));
@@ -13957,8 +13927,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
              TYPE_TAIL_CALL_LIST (func_type) = call_site;
            }
          else
-           complaint (&symfile_complaints,
-                      _("Cannot find function owning DW_TAG_call_site "
+           complaint (_("Cannot find function owning DW_TAG_call_site "
                         "DIE %s [in module %s]"),
                       sect_offset_str (die->sect_off), objfile_name (objfile));
        }
@@ -14004,8 +13973,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
          if (target_physname == NULL)
            target_physname = dwarf2_physname (NULL, target_die, target_cu);
          if (target_physname == NULL)
-           complaint (&symfile_complaints,
-                      _("DW_AT_call_target target DIE has invalid "
+           complaint (_("DW_AT_call_target target DIE has invalid "
                         "physname, for referencing DIE %s [in module %s]"),
                       sect_offset_str (die->sect_off), objfile_name (objfile));
          else
@@ -14018,8 +13986,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
          /* DW_AT_entry_pc should be preferred.  */
          if (dwarf2_get_pc_bounds (target_die, &lowpc, NULL, target_cu, NULL)
              <= PC_BOUNDS_INVALID)
-           complaint (&symfile_complaints,
-                      _("DW_AT_call_target target DIE has invalid "
+           complaint (_("DW_AT_call_target target DIE has invalid "
                         "low pc, for referencing DIE %s [in module %s]"),
                       sect_offset_str (die->sect_off), objfile_name (objfile));
          else
@@ -14030,8 +13997,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
        }
     }
   else
-    complaint (&symfile_complaints,
-              _("DW_TAG_call_site DW_AT_call_target is neither "
+    complaint (_("DW_TAG_call_site DW_AT_call_target is neither "
                 "block nor reference, for DIE %s [in module %s]"),
               sect_offset_str (die->sect_off), objfile_name (objfile));
 
@@ -14077,8 +14043,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
              /* As DW_OP_GNU_parameter_ref uses CU-relative offset this
                 binding can be done only inside one CU.  Such referenced DIE
                 therefore cannot be even moved to DW_TAG_partial_unit.  */
-             complaint (&symfile_complaints,
-                        _("DW_AT_call_parameter offset is not in CU for "
+             complaint (_("DW_AT_call_parameter offset is not in CU for "
                           "DW_TAG_call_site child DIE %s [in module %s]"),
                         sect_offset_str (child_die->sect_off),
                         objfile_name (objfile));
@@ -14089,8 +14054,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
        }
       else if (loc == NULL || origin != NULL || !attr_form_is_block (loc))
        {
-         complaint (&symfile_complaints,
-                    _("No DW_FORM_block* DW_AT_location for "
+         complaint (_("No DW_FORM_block* DW_AT_location for "
                       "DW_TAG_call_site child DIE %s [in module %s]"),
                     sect_offset_str (child_die->sect_off), objfile_name (objfile));
          continue;
@@ -14107,8 +14071,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
            parameter->kind = CALL_SITE_PARAMETER_FB_OFFSET;
          else
            {
-             complaint (&symfile_complaints,
-                        _("Only single DW_OP_reg or DW_OP_fbreg is supported "
+             complaint (_("Only single DW_OP_reg or DW_OP_fbreg is supported "
                           "for DW_FORM_block* DW_AT_location is supported for "
                           "DW_TAG_call_site child DIE %s "
                           "[in module %s]"),
@@ -14123,8 +14086,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
        attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_value, cu);
       if (!attr_form_is_block (attr))
        {
-         complaint (&symfile_complaints,
-                    _("No DW_FORM_block* DW_AT_call_value for "
+         complaint (_("No DW_FORM_block* DW_AT_call_value for "
                       "DW_TAG_call_site child DIE %s [in module %s]"),
                     sect_offset_str (child_die->sect_off),
                     objfile_name (objfile));
@@ -14144,8 +14106,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
       if (attr)
        {
          if (!attr_form_is_block (attr))
-           complaint (&symfile_complaints,
-                      _("No DW_FORM_block* DW_AT_call_data_value for "
+           complaint (_("No DW_FORM_block* DW_AT_call_data_value for "
                         "DW_TAG_call_site child DIE %s [in module %s]"),
                       sect_offset_str (child_die->sect_off),
                       objfile_name (objfile));
@@ -14238,8 +14199,7 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
   dwarf2_read_section (objfile, &dwarf2_per_objfile->rnglists);
   if (offset >= dwarf2_per_objfile->rnglists.size)
     {
-      complaint (&symfile_complaints,
-                _("Offset %d out of bounds for DW_AT_ranges attribute"),
+      complaint (_("Offset %d out of bounds for DW_AT_ranges attribute"),
                 offset);
       return false;
     }
@@ -14320,8 +14280,7 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
          buffer += bytes_read;
          break;
        default:
-         complaint (&symfile_complaints,
-                    _("Invalid .debug_rnglists data (no base address)"));
+         complaint (_("Invalid .debug_rnglists data (no base address)"));
          return false;
        }
       if (rlet == DW_RLE_end_of_list || overflow)
@@ -14333,16 +14292,14 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
        {
          /* We have no valid base address for the ranges
             data.  */
-         complaint (&symfile_complaints,
-                    _("Invalid .debug_rnglists data (no base address)"));
+         complaint (_("Invalid .debug_rnglists data (no base address)"));
          return false;
        }
 
       if (range_beginning > range_end)
        {
          /* Inverted range entries are invalid.  */
-         complaint (&symfile_complaints,
-                    _("Invalid .debug_rnglists data (inverted range)"));
+         complaint (_("Invalid .debug_rnglists data (inverted range)"));
          return false;
        }
 
@@ -14358,8 +14315,7 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
       if (range_beginning + baseaddr == 0
          && !dwarf2_per_objfile->has_section_at_zero)
        {
-         complaint (&symfile_complaints,
-                    _(".debug_rnglists entry has start address of zero"
+         complaint (_(".debug_rnglists entry has start address of zero"
                       " [in module %s]"), objfile_name (objfile));
          continue;
        }
@@ -14369,8 +14325,7 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
 
   if (overflow)
     {
-      complaint (&symfile_complaints,
-                _("Offset %d is not terminated "
+      complaint (_("Offset %d is not terminated "
                   "for DW_AT_ranges attribute"),
                 offset);
       return false;
@@ -14412,8 +14367,7 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu,
   dwarf2_read_section (objfile, &dwarf2_per_objfile->ranges);
   if (offset >= dwarf2_per_objfile->ranges.size)
     {
-      complaint (&symfile_complaints,
-                _("Offset %d out of bounds for DW_AT_ranges attribute"),
+      complaint (_("Offset %d out of bounds for DW_AT_ranges attribute"),
                 offset);
       return 0;
     }
@@ -14452,16 +14406,14 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu,
        {
          /* We have no valid base address for the ranges
             data.  */
-         complaint (&symfile_complaints,
-                    _("Invalid .debug_ranges data (no base address)"));
+         complaint (_("Invalid .debug_ranges data (no base address)"));
          return 0;
        }
 
       if (range_beginning > range_end)
        {
          /* Inverted range entries are invalid.  */
-         complaint (&symfile_complaints,
-                    _("Invalid .debug_ranges data (inverted range)"));
+         complaint (_("Invalid .debug_ranges data (inverted range)"));
          return 0;
        }
 
@@ -14477,8 +14429,7 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu,
       if (range_beginning + baseaddr == 0
          && !dwarf2_per_objfile->has_section_at_zero)
        {
-         complaint (&symfile_complaints,
-                    _(".debug_ranges entry has start address of zero"
+         complaint (_(".debug_ranges entry has start address of zero"
                       " [in module %s]"), objfile_name (objfile));
          continue;
        }
@@ -15154,8 +15105,7 @@ dwarf2_add_type_defn (struct field_info *fip, struct die_info *die,
       fp.is_protected = 1;
       break;
     default:
-      complaint (&symfile_complaints,
-                _("Unhandled DW_AT_accessibility value (%x)"), accessibility);
+      complaint (_("Unhandled DW_AT_accessibility value (%x)"), accessibility);
     }
 
   if (die->tag == DW_TAG_typedef)
@@ -15252,7 +15202,7 @@ dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type,
        default:
          /* Unknown accessibility.  Complain and treat it as public.  */
          {
-           complaint (&symfile_complaints, _("unsupported accessibility %d"),
+           complaint (_("unsupported accessibility %d"),
                       field.accessibility);
          }
          break;
@@ -15381,7 +15331,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
        fnp->voffset = VOFFSET_STATIC;
     }
   else
-    complaint (&symfile_complaints, _("member function type missing for '%s'"),
+    complaint (_("member function type missing for '%s'"),
               dwarf2_full_name (fieldname, die, cu));
 
   /* Get fcontext from DW_AT_containing_type if present.  */
@@ -15453,8 +15403,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
              if (TYPE_NFIELDS (this_type) == 0
                  || !TYPE_FIELD_ARTIFICIAL (this_type, 0))
                {
-                 complaint (&symfile_complaints,
-                            _("cannot determine context for virtual member "
+                 complaint (_("cannot determine context for virtual member "
                               "function \"%s\" (offset %s)"),
                             fieldname, sect_offset_str (die->sect_off));
                }
@@ -15481,8 +15430,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
       if (attr && DW_UNSND (attr))
        {
          /* GCC does this, as of 2008-08-25; PR debug/37237.  */
-         complaint (&symfile_complaints,
-                    _("Member function \"%s\" (offset %s) is virtual "
+         complaint (_("Member function \"%s\" (offset %s) is virtual "
                       "but the vtable offset is not specified"),
                     fieldname, sect_offset_str (die->sect_off));
          ALLOCATE_CPLUS_STRUCT_TYPE (type);
@@ -15595,8 +15543,7 @@ get_alignment (struct dwarf2_cu *cu, struct die_info *die)
 
   if (!attr_form_is_constant (attr))
     {
-      complaint (&symfile_complaints,
-                _("DW_AT_alignment must have constant form"
+      complaint (_("DW_AT_alignment must have constant form"
                   " - DIE at %s [in module %s]"),
                 sect_offset_str (die->sect_off),
                 objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15609,8 +15556,7 @@ get_alignment (struct dwarf2_cu *cu, struct die_info *die)
       LONGEST val = DW_SND (attr);
       if (val < 0)
        {
-         complaint (&symfile_complaints,
-                    _("DW_AT_alignment value must not be negative"
+         complaint (_("DW_AT_alignment value must not be negative"
                       " - DIE at %s [in module %s]"),
                     sect_offset_str (die->sect_off),
                     objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15623,8 +15569,7 @@ get_alignment (struct dwarf2_cu *cu, struct die_info *die)
 
   if (align == 0)
     {
-      complaint (&symfile_complaints,
-                _("DW_AT_alignment value must not be zero"
+      complaint (_("DW_AT_alignment value must not be zero"
                   " - DIE at %s [in module %s]"),
                 sect_offset_str (die->sect_off),
                 objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15632,8 +15577,7 @@ get_alignment (struct dwarf2_cu *cu, struct die_info *die)
     }
   if ((align & (align - 1)) != 0)
     {
-      complaint (&symfile_complaints,
-                _("DW_AT_alignment value must be a power of 2"
+      complaint (_("DW_AT_alignment value must be a power of 2"
                   " - DIE at %s [in module %s]"),
                 sect_offset_str (die->sect_off),
                 objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15651,8 +15595,7 @@ maybe_set_alignment (struct dwarf2_cu *cu, struct die_info *die,
                     struct type *type)
 {
   if (!set_type_align (type, get_alignment (cu, die)))
-    complaint (&symfile_complaints,
-              _("DW_AT_alignment value too large"
+    complaint (_("DW_AT_alignment value too large"
                 " - DIE at %s [in module %s]"),
               sect_offset_str (die->sect_off),
               objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15708,18 +15651,13 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
          if (get_die_type (die, cu) != NULL)
            return get_die_type (die, cu);
 
-         TYPE_TAG_NAME (type) = full_name;
-         if (die->tag == DW_TAG_structure_type
-             || die->tag == DW_TAG_class_type)
-           TYPE_NAME (type) = TYPE_TAG_NAME (type);
+         TYPE_NAME (type) = full_name;
        }
       else
        {
          /* The name is already allocated along with this objfile, so
             we don't need to duplicate it for the type.  */
-         TYPE_TAG_NAME (type) = name;
-         if (die->tag == DW_TAG_class_type)
-           TYPE_NAME (type) = TYPE_TAG_NAME (type);
+         TYPE_NAME (type) = name;
        }
     }
 
@@ -15867,8 +15805,7 @@ handle_struct_member_die (struct die_info *child_die, struct type *type,
       /* We don't handle this but we might as well report it if we see
         it.  */
       if (dwarf2_attr (child_die, DW_AT_discr_list, cu) != nullptr)
-         complaint (&symfile_complaints,
-                    _("DW_AT_discr_list is not supported yet"
+         complaint (_("DW_AT_discr_list is not supported yet"
                       " - DIE at %s [in module %s]"),
                     sect_offset_str (child_die->sect_off),
                     objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15921,8 +15858,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
        }
       else
        {
-         complaint (&symfile_complaints,
-                    _("DW_AT_discr does not have DIE reference form"
+         complaint (_("DW_AT_discr does not have DIE reference form"
                       " - DIE at %s [in module %s]"),
                     sect_offset_str (die->sect_off),
                     objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -15999,11 +15935,9 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
 
                  /* Complain if virtual function table field not found.  */
                  if (i < TYPE_N_BASECLASSES (t))
-                   complaint (&symfile_complaints,
-                              _("virtual function table pointer "
+                   complaint (_("virtual function table pointer "
                                 "not found when defining class '%s'"),
-                              TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) :
-                              "");
+                              TYPE_NAME (type) ? TYPE_NAME (type) : "");
                }
              else
                {
@@ -16193,7 +16127,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
   TYPE_CODE (type) = TYPE_CODE_ENUM;
   name = dwarf2_full_name (NULL, die, cu);
   if (name != NULL)
-    TYPE_TAG_NAME (type) = name;
+    TYPE_NAME (type) = name;
 
   attr = dwarf2_attr (die, DW_AT_type, cu);
   if (attr != NULL)
@@ -16373,8 +16307,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
       stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop);
       if (!stride_ok)
        {
-         complaint (&symfile_complaints,
-                    _("unable to read array DW_AT_byte_stride "
+         complaint (_("unable to read array DW_AT_byte_stride "
                       " - DIE at %s [in module %s]"),
                     sect_offset_str (die->sect_off),
                     objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -16458,8 +16391,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
       if (DW_UNSND (attr) >= TYPE_LENGTH (type))
        TYPE_LENGTH (type) = DW_UNSND (attr);
       else
-       complaint (&symfile_complaints,
-                  _("DW_AT_byte_size for array type smaller "
+       complaint (_("DW_AT_byte_size for array type smaller "
                     "than the total size of elements"));
     }
 
@@ -16685,8 +16617,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
                     not specified by DWARF.  It seems to have been
                     emitted by gfortran at least as recently as:
                     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23057.  */
-                 complaint (&symfile_complaints,
-                            _("Variable in common block has "
+                 complaint (_("Variable in common block has "
                               "DW_AT_data_member_location "
                               "- DIE at %s [in module %s]"),
                               sect_offset_str (child_die->sect_off),
@@ -16747,7 +16678,6 @@ read_namespace_type (struct die_info *die, struct dwarf2_cu *cu)
 
   /* Create the type.  */
   type = init_type (objfile, TYPE_CODE_NAMESPACE, 0, name);
-  TYPE_TAG_NAME (type) = TYPE_NAME (type);
 
   return set_die_type (die, type, cu);
 }
@@ -16808,14 +16738,10 @@ read_module_type (struct die_info *die, struct dwarf2_cu *cu)
 
   module_name = dwarf2_name (die, cu);
   if (!module_name)
-    complaint (&symfile_complaints,
-              _("DW_TAG_module has no name, offset %s"),
+    complaint (_("DW_TAG_module has no name, offset %s"),
                sect_offset_str (die->sect_off));
   type = init_type (objfile, TYPE_CODE_MODULE, 0, module_name);
 
-  /* determine_prefix uses TYPE_TAG_NAME.  */
-  TYPE_TAG_NAME (type) = TYPE_NAME (type);
-
   return set_die_type (die, type, cu);
 }
 
@@ -16928,13 +16854,11 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu)
        }
       else if (TYPE_LENGTH (type) != byte_size)
        {
-         complaint (&symfile_complaints,
-                    _("invalid pointer size %d"), byte_size);
+         complaint (_("invalid pointer size %d"), byte_size);
        }
       else if (TYPE_RAW_ALIGN (type) != alignment)
        {
-         complaint (&symfile_complaints,
-                    _("Invalid DW_AT_alignment"
+         complaint (_("Invalid DW_AT_alignment"
                       " - DIE at %s [in module %s]"),
                     sect_offset_str (die->sect_off),
                     objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -17367,8 +17291,7 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu)
     {
       /* Self-referential typedefs are, it seems, not allowed by the DWARF
         spec and cause infinite loops in GDB.  */
-      complaint (&symfile_complaints,
-                _("Self-referential DW_TAG_typedef "
+      complaint (_("Self-referential DW_TAG_typedef "
                   "- DIE at %s [in module %s]"),
                 sect_offset_str (die->sect_off), objfile_name (objfile));
       TYPE_TARGET_TYPE (this_type) = NULL;
@@ -17422,8 +17345,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
   name = dwarf2_name (die, cu);
   if (!name)
     {
-      complaint (&symfile_complaints,
-                _("DW_AT_name missing from DW_TAG_base_type"));
+      complaint (_("DW_AT_name missing from DW_TAG_base_type"));
     }
 
   switch (encoding)
@@ -17484,8 +17406,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
            type = builtin_type (arch)->builtin_char32;
          else
            {
-             complaint (&symfile_complaints,
-                        _("unsupported DW_ATE_UTF bit size: '%d'"),
+             complaint (_("unsupported DW_ATE_UTF bit size: '%d'"),
                         bits);
              type = init_integer_type (objfile, bits, 1, name);
            }
@@ -17494,7 +17415,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
        break;
 
       default:
-       complaint (&symfile_complaints, _("unsupported DW_AT_encoding: '%s'"),
+       complaint (_("unsupported DW_AT_encoding: '%s'"),
                   dwarf_type_encoding_name (encoding));
        type = init_type (objfile, TYPE_CODE_ERROR, bits, name);
        break;
@@ -17677,7 +17598,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
   if (attr)
     attr_to_dynamic_prop (attr, die, cu, &low);
   else if (!low_default_is_valid)
-    complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
+    complaint (_("Missing DW_AT_lower_bound "
                                      "- DIE at %s [in module %s]"),
               sect_offset_str (die->sect_off),
               objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -18310,8 +18231,7 @@ load_partial_dies (const struct die_reader_specs *reader,
         above.  In correct DWARF DW_TAG_typedef should have no children.  */
 
       if (pdi.tag == DW_TAG_typedef && pdi.has_children)
-       complaint (&symfile_complaints,
-                  _("DW_TAG_typedef has childen - GCC PR debug/47510 bug "
+       complaint (_("DW_TAG_typedef has childen - GCC PR debug/47510 bug "
                     "- DIE at %s [in module %s]"),
                   sect_offset_str (pdi.sect_off), objfile_name (objfile));
 
@@ -18326,8 +18246,7 @@ load_partial_dies (const struct die_reader_specs *reader,
          && parent_die->has_specification == 0)
        {
          if (pdi.name == NULL)
-           complaint (&symfile_complaints,
-                      _("malformed enumerator DIE ignored"));
+           complaint (_("malformed enumerator DIE ignored"));
          else if (building_psymtab)
            add_psymbol_to_list (pdi.name, strlen (pdi.name), 0,
                                 VAR_DOMAIN, LOC_CONST,
@@ -18548,8 +18467,7 @@ partial_die_info::read (const struct die_reader_specs *reader,
          /* Ignore absolute siblings, they might point outside of
             the current compile unit.  */
          if (attr.form == DW_FORM_ref_addr)
-           complaint (&symfile_complaints,
-                      _("ignoring absolute DW_AT_sibling"));
+           complaint (_("ignoring absolute DW_AT_sibling"));
          else
            {
              const gdb_byte *buffer = reader->buffer;
@@ -18557,8 +18475,7 @@ partial_die_info::read (const struct die_reader_specs *reader,
              const gdb_byte *sibling_ptr = buffer + to_underlying (off);
 
              if (sibling_ptr < info_ptr)
-               complaint (&symfile_complaints,
-                          _("DW_AT_sibling points backwards"));
+               complaint (_("DW_AT_sibling points backwards"));
              else if (sibling_ptr > reader->buffer_end)
                dwarf2_section_buffer_overflow_complaint (reader->die_section);
              else
@@ -18632,8 +18549,7 @@ partial_die_info::read (const struct die_reader_specs *reader,
          struct objfile *objfile = dwarf2_per_objfile->objfile;
          struct gdbarch *gdbarch = get_objfile_arch (objfile);
 
-         complaint (&symfile_complaints,
-                    _("DW_AT_low_pc %s is zero "
+         complaint (_("DW_AT_low_pc %s is zero "
                       "for DIE at %s [in module %s]"),
                     paddress (gdbarch, lowpc),
                     sect_offset_str (sect_off),
@@ -18645,8 +18561,7 @@ partial_die_info::read (const struct die_reader_specs *reader,
          struct objfile *objfile = dwarf2_per_objfile->objfile;
          struct gdbarch *gdbarch = get_objfile_arch (objfile);
 
-         complaint (&symfile_complaints,
-                    _("DW_AT_low_pc %s is not < DW_AT_high_pc %s "
+         complaint (_("DW_AT_low_pc %s is not < DW_AT_high_pc %s "
                       "for DIE at %s [in module %s]"),
                     paddress (gdbarch, lowpc),
                     paddress (gdbarch, highpc),
@@ -19128,8 +19043,7 @@ read_attribute_value (const struct die_reader_specs *reader,
       && DW_UNSND (attr) >= 0xffffffff)
     {
       complaint
-        (&symfile_complaints,
-         _("Suspicious DW_AT_byte_size value treated as zero instead of %s"),
+        (_("Suspicious DW_AT_byte_size value treated as zero instead of %s"),
          hex_string (DW_UNSND (attr)));
       DW_UNSND (attr) = 0;
     }
@@ -19327,8 +19241,7 @@ read_checked_initial_length_and_offset (bfd *abfd, const gdb_byte *buf,
              || cu_header->initial_length_size == 12);
 
   if (cu_header->initial_length_size != *bytes_read)
-    complaint (&symfile_complaints,
-              _("intermixed 32-bit and 64-bit DWARF sections"));
+    complaint (_("intermixed 32-bit and 64-bit DWARF sections"));
 
   *offset_size = (*bytes_read == 4) ? 4 : 8;
   return length;
@@ -19676,7 +19589,7 @@ dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu,
 
       /* Note: We can't use init_cutu_and_read_dies_simple here,
         we need addr_base.  */
-      init_cutu_and_read_dies (per_cu, NULL, 0, 0,
+      init_cutu_and_read_dies (per_cu, NULL, 0, 0, false,
                               dwarf2_read_addr_index_reader, &aidata);
       addr_base = aidata.addr_base;
       addr_size = aidata.addr_size;
@@ -19873,8 +19786,7 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c
          || attr->form == DW_FORM_GNU_strp_alt)
        str = DW_STRING (attr);
       else
-        complaint (&symfile_complaints,
-                  _("string type expected for attribute %s for "
+        complaint (_("string type expected for attribute %s for "
                     "DIE at %s in module %s"),
                   dwarf_attr_name (name), sect_offset_str (die->sect_off),
                   objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
@@ -20106,8 +20018,7 @@ read_formatted_entries (struct dwarf2_per_objfile *dwarf2_per_objfile,
            case DW_LNCT_MD5:
              break;
            default:
-             complaint (&symfile_complaints,
-                        _("Unknown format content type %s"),
+             complaint (_("Unknown format content type %s"),
                         pulongest (content_type));
            }
        }
@@ -20145,9 +20056,9 @@ dwarf_decode_line_header (sect_offset sect_off, struct dwarf2_cu *cu)
   if (section->buffer == NULL)
     {
       if (cu->dwo_unit && cu->per_cu->is_debug_types)
-       complaint (&symfile_complaints, _("missing .debug_line.dwo section"));
+       complaint (_("missing .debug_line.dwo section"));
       else
-       complaint (&symfile_complaints, _("missing .debug_line section"));
+       complaint (_("missing .debug_line section"));
       return 0;
     }
 
@@ -20187,8 +20098,7 @@ dwarf_decode_line_header (sect_offset sect_off, struct dwarf2_cu *cu)
     {
       /* This is a version we don't understand.  The format could have
         changed in ways we don't handle properly so just punt.  */
-      complaint (&symfile_complaints,
-                _("unsupported version in .debug_line section"));
+      complaint (_("unsupported version in .debug_line section"));
       return NULL;
     }
   if (lh->version >= 5)
@@ -20203,8 +20113,7 @@ dwarf_decode_line_header (sect_offset sect_off, struct dwarf2_cu *cu)
       line_ptr += 1;
       if (segment_selector_size != 0)
        {
-         complaint (&symfile_complaints,
-                    _("unsupported segment selector size %u "
+         complaint (_("unsupported segment selector size %u "
                       "in .debug_line section"),
                     segment_selector_size);
          return NULL;
@@ -20225,8 +20134,7 @@ dwarf_decode_line_header (sect_offset sect_off, struct dwarf2_cu *cu)
   if (lh->maximum_ops_per_instruction == 0)
     {
       lh->maximum_ops_per_instruction = 1;
-      complaint (&symfile_complaints,
-                _("invalid maximum_ops_per_instruction "
+      complaint (_("invalid maximum_ops_per_instruction "
                   "in `.debug_line' section"));
     }
 
@@ -20300,8 +20208,7 @@ dwarf_decode_line_header (sect_offset sect_off, struct dwarf2_cu *cu)
   lh->statement_program_start = line_ptr;
 
   if (line_ptr > (section->buffer + section->size))
-    complaint (&symfile_complaints,
-              _("line number info header doesn't "
+    complaint (_("line number info header doesn't "
                 "fit in `.debug_line' section"));
 
   return lh;
@@ -20767,8 +20674,7 @@ lnp_state_machine::check_line_address (struct dwarf2_cu *cu,
       struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
       long line_offset = line_ptr - get_debug_line_section (cu)->buffer;
 
-      complaint (&symfile_complaints,
-                _(".debug_line address at offset 0x%lx is 0 [in module %s]"),
+      complaint (_(".debug_line address at offset 0x%lx is 0 [in module %s]"),
                 line_offset, objfile_name (objfile));
       m_record_line_callback = noop_record_line;
       /* Note: record_line_callback is left as noop_record_line until
@@ -20895,8 +20801,7 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
                  }
                  break;
                default:
-                 complaint (&symfile_complaints,
-                            _("mangled .debug_line section"));
+                 complaint (_("mangled .debug_line section"));
                  return;
                }
              /* Make sure that we parsed the extended op correctly.  If e.g.
@@ -20904,8 +20809,7 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
                 we may have read the wrong number of bytes.  */
              if (line_ptr != extended_end)
                {
-                 complaint (&symfile_complaints,
-                            _("mangled .debug_line section"));
+                 complaint (_("mangled .debug_line section"));
                  return;
                }
              break;
@@ -21284,8 +21188,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
            fe = NULL;
 
          if (fe == NULL)
-           complaint (&symfile_complaints,
-                      _("file index out of range"));
+           complaint (_("file index out of range"));
          else
            symbol_set_symtab (sym, fe->symtab);
        }
@@ -21570,7 +21473,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
             trash data, but since we must specifically ignore things
             we don't recognize, there is nothing else we should do at
             this point.  */
-         complaint (&symfile_complaints, _("unsupported tag: '%s'"),
+         complaint (_("unsupported tag: '%s'"),
                     dwarf_tag_name (die->tag));
          break;
        }
@@ -21728,8 +21631,7 @@ dwarf2_const_value_attr (const struct attribute *attr, struct type *type,
       break;
 
     default:
-      complaint (&symfile_complaints,
-                _("unsupported const value attribute form: '%s'"),
+      complaint (_("unsupported const value attribute form: '%s'"),
                 dwarf_form_name (attr->form));
       *value = 0;
       break;
@@ -21913,8 +21815,7 @@ lookup_die_type (struct die_info *die, const struct attribute *attr,
     }
   else
     {
-      complaint (&symfile_complaints,
-                _("Dwarf Error: Bad type attribute %s in DIE"
+      complaint (_("Dwarf Error: Bad type attribute %s in DIE"
                   " at %s [in module %s]"),
                 dwarf_attr_name (attr->name), sect_offset_str (die->sect_off),
                 objfile_name (objfile));
@@ -22042,8 +21943,7 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu)
       this_type = read_tag_atomic_type (die, cu);
       break;
     default:
-      complaint (&symfile_complaints,
-                _("unexpected tag in read_type_die: '%s'"),
+      complaint (_("unexpected tag in read_type_die: '%s'"),
                 dwarf_tag_name (die->tag));
       break;
     }
@@ -22257,8 +22157,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
         doesn't allow it), and break the loop here.  */
       name = dwarf2_name (die, cu);
       parent_name = dwarf2_name (parent, cu);
-      complaint (&symfile_complaints,
-                _("template param type '%s' defined within parent '%s'"),
+      complaint (_("template param type '%s' defined within parent '%s'"),
                 name ? name : "<unknown>",
                 parent_name ? parent_name : "<unknown>");
       return "";
@@ -22272,18 +22171,18 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
           DW_TAG_namespace DIEs with a name of "::" for the global namespace.
           Work around this problem here.  */
        if (cu->language == language_cplus
-           && strcmp (TYPE_TAG_NAME (parent_type), "::") == 0)
+           && strcmp (TYPE_NAME (parent_type), "::") == 0)
          return "";
        /* We give a name to even anonymous namespaces.  */
-       return TYPE_TAG_NAME (parent_type);
+       return TYPE_NAME (parent_type);
       case DW_TAG_class_type:
       case DW_TAG_interface_type:
       case DW_TAG_structure_type:
       case DW_TAG_union_type:
       case DW_TAG_module:
        parent_type = read_type_die (parent, cu);
-       if (TYPE_TAG_NAME (parent_type) != NULL)
-         return TYPE_TAG_NAME (parent_type);
+       if (TYPE_NAME (parent_type) != NULL)
+         return TYPE_NAME (parent_type);
        else
          /* An anonymous structure is only allowed non-static data
             members; no typedefs, no member functions, et cetera.
@@ -22308,8 +22207,8 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
        parent_type = read_type_die (parent, cu);
        if (TYPE_DECLARED_CLASS (parent_type))
          {
-           if (TYPE_TAG_NAME (parent_type) != NULL)
-             return TYPE_TAG_NAME (parent_type);
+           if (TYPE_NAME (parent_type) != NULL)
+             return TYPE_NAME (parent_type);
            return "";
          }
        /* Fall through.  */
@@ -22793,8 +22692,7 @@ dwarf2_get_ref_die_offset (const struct attribute *attr)
   if (attr_form_is_ref (attr))
     return (sect_offset) DW_UNSND (attr);
 
-  complaint (&symfile_complaints,
-            _("unsupported die ref attribute form: '%s'"),
+  complaint (_("unsupported die ref attribute form: '%s'"),
             dwarf_form_name (attr->form));
   return {};
 }
@@ -22816,8 +22714,7 @@ dwarf2_get_attr_constant_value (const struct attribute *attr, int default_value)
   else
     {
       /* For DW_FORM_data16 see attr_form_is_constant.  */
-      complaint (&symfile_complaints,
-                _("Attribute value is not a constant (%s)"),
+      complaint (_("Attribute value is not a constant (%s)"),
                  dwarf_form_name (attr->form));
       return default_value;
     }
@@ -22883,7 +22780,7 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz,
 
       /* If necessary, add it to the queue and load its DIEs.  */
       if (maybe_queue_comp_unit (cu, per_cu, cu->language))
-       load_full_comp_unit (per_cu, cu->language);
+       load_full_comp_unit (per_cu, false, cu->language);
 
       target_cu = per_cu->cu;
     }
@@ -22891,7 +22788,7 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz,
     {
       /* We're loading full DIEs during partial symbol reading.  */
       gdb_assert (dwarf2_per_objfile->reading_partial_symbols);
-      load_full_comp_unit (cu->per_cu, language_minimal);
+      load_full_comp_unit (cu->per_cu, false, language_minimal);
     }
 
   *ref_cu = target_cu;
@@ -22945,7 +22842,7 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
   struct objfile *objfile = dwarf2_per_objfile->objfile;
 
   if (per_cu->cu == NULL)
-    load_cu (per_cu);
+    load_cu (per_cu, false);
   cu = per_cu->cu;
   if (cu == NULL)
     {
@@ -23052,7 +22949,7 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off,
   struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
 
   if (per_cu->cu == NULL)
-    load_cu (per_cu);
+    load_cu (per_cu, false);
   cu = per_cu->cu;
   if (cu == NULL)
     {
@@ -23154,8 +23051,7 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off,
       break;
 
     default:
-      complaint (&symfile_complaints,
-                _("unsupported const value attribute form: '%s'"),
+      complaint (_("unsupported const value attribute form: '%s'"),
                 dwarf_form_name (attr->form));
       break;
     }
@@ -23174,7 +23070,7 @@ dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
   struct die_info *die;
 
   if (per_cu->cu == NULL)
-    load_cu (per_cu);
+    load_cu (per_cu, false);
   cu = per_cu->cu;
   if (!cu)
     return NULL;
@@ -23306,8 +23202,7 @@ get_signatured_type (struct die_info *die, ULONGEST signature,
      the debug info.  */
   if (sig_type == NULL)
     {
-      complaint (&symfile_complaints,
-                _("Dwarf Error: Cannot find signatured DIE %s referenced"
+      complaint (_("Dwarf Error: Cannot find signatured DIE %s referenced"
                   " from DIE at %s [in module %s]"),
                 hex_string (signature), sect_offset_str (die->sect_off),
                 objfile_name (dwarf2_per_objfile->objfile));
@@ -23328,8 +23223,7 @@ get_signatured_type (struct die_info *die, ULONGEST signature,
       type = read_type_die (type_die, type_cu);
       if (type == NULL)
        {
-         complaint (&symfile_complaints,
-                    _("Dwarf Error: Cannot build signatured type %s"
+         complaint (_("Dwarf Error: Cannot build signatured type %s"
                       " referenced from DIE at %s [in module %s]"),
                     hex_string (signature), sect_offset_str (die->sect_off),
                     objfile_name (dwarf2_per_objfile->objfile));
@@ -23338,8 +23232,7 @@ get_signatured_type (struct die_info *die, ULONGEST signature,
     }
   else
     {
-      complaint (&symfile_complaints,
-                _("Dwarf Error: Problem reading signatured DIE %s referenced"
+      complaint (_("Dwarf Error: Problem reading signatured DIE %s referenced"
                   " from DIE at %s [in module %s]"),
                 hex_string (signature), sect_offset_str (die->sect_off),
                 objfile_name (dwarf2_per_objfile->objfile));
@@ -23374,8 +23267,7 @@ get_DW_AT_signature_type (struct die_info *die, const struct attribute *attr,
       struct dwarf2_per_objfile *dwarf2_per_objfile
        = cu->per_cu->dwarf2_per_objfile;
 
-      complaint (&symfile_complaints,
-                _("Dwarf Error: DW_AT_signature has bad form %s in DIE"
+      complaint (_("Dwarf Error: DW_AT_signature has bad form %s in DIE"
                   " at %s [in module %s]"),
                 dwarf_form_name (attr->form), sect_offset_str (die->sect_off),
                 objfile_name (dwarf2_per_objfile->objfile));
@@ -23455,7 +23347,7 @@ read_signatured_type (struct signatured_type *sig_type)
   gdb_assert (per_cu->is_debug_types);
   gdb_assert (per_cu->cu == NULL);
 
-  init_cutu_and_read_dies (per_cu, NULL, 0, 1,
+  init_cutu_and_read_dies (per_cu, NULL, 0, 1, false,
                           read_signatured_type_reader, NULL);
   sig_type->per_cu.tu_read = 1;
 }
@@ -23695,10 +23587,10 @@ decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
            const char *name = get_DW_OP_name (op);
 
            if (name)
-             complaint (&symfile_complaints, _("unsupported stack op: '%s'"),
+             complaint (_("unsupported stack op: '%s'"),
                         name);
            else
-             complaint (&symfile_complaints, _("unsupported stack op: '%02x'"),
+             complaint (_("unsupported stack op: '%02x'"),
                         op);
          }
 
@@ -23709,15 +23601,13 @@ decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
          outside of the allocated space.  Also enforce minimum>0.  */
       if (stacki >= ARRAY_SIZE (stack) - 1)
        {
-         complaint (&symfile_complaints,
-                    _("location description stack overflow"));
+         complaint (_("location description stack overflow"));
          return 0;
        }
 
       if (stacki <= 0)
        {
-         complaint (&symfile_complaints,
-                    _("location description stack underflow"));
+         complaint (_("location description stack underflow"));
          return 0;
        }
     }
@@ -23780,8 +23670,7 @@ file_file_name (int file, struct line_header *lh)
       xsnprintf (fake_name, sizeof (fake_name),
                 "<bad macro file number %d>", file);
 
-      complaint (&symfile_complaints,
-                 _("bad file number in macro information (%d)"),
+      complaint (_("bad file number in macro information (%d)"),
                  file);
 
       return xstrdup (fake_name);
@@ -23843,8 +23732,7 @@ consume_improper_spaces (const char *p, const char *body)
 {
   if (*p == ' ')
     {
-      complaint (&symfile_complaints,
-                _("macro definition contains spaces "
+      complaint (_("macro definition contains spaces "
                   "in formal argument list:\n`%s'"),
                 body);
 
@@ -24073,8 +23961,7 @@ skip_form_bytes (bfd *abfd, const gdb_byte *bytes, const gdb_byte *buffer_end,
 
     default:
       {
-       complaint (&symfile_complaints,
-                  _("invalid form 0x%x in `%s'"),
+       complaint (_("invalid form 0x%x in `%s'"),
                   form, get_section_name (section));
        return NULL;
       }
@@ -24101,8 +23988,7 @@ skip_unknown_opcode (unsigned int opcode,
 
   if (opcode_definitions[opcode] == NULL)
     {
-      complaint (&symfile_complaints,
-                _("unrecognized DW_MACFINO opcode 0x%x"),
+      complaint (_("unrecognized DW_MACFINO opcode 0x%x"),
                 opcode);
       return NULL;
     }
@@ -24147,8 +24033,7 @@ dwarf_parse_macro_header (const gdb_byte **opcode_definitions,
       version = read_2_bytes (abfd, mac_ptr);
       if (version != 4 && version != 5)
        {
-         complaint (&symfile_complaints,
-                    _("unrecognized version `%d' in .debug_macro section"),
+         complaint (_("unrecognized version `%d' in .debug_macro section"),
                     version);
          return NULL;
        }
@@ -24295,8 +24180,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
             if (! current_file)
              {
                /* DWARF violation as no main source is present.  */
-               complaint (&symfile_complaints,
-                          _("debug info with no main source gives macro %s "
+               complaint (_("debug info with no main source gives macro %s "
                             "on line %d: %s"),
                           is_define ? _("definition") : _("undefinition"),
                           line, body);
@@ -24304,8 +24188,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
              }
            if ((line == 0 && !at_commandline)
                || (line != 0 && at_commandline))
-             complaint (&symfile_complaints,
-                        _("debug info gives %s macro %s with %s line %d: %s"),
+             complaint (_("debug info gives %s macro %s with %s line %d: %s"),
                         at_commandline ? _("command-line") : _("in-file"),
                         is_define ? _("definition") : _("undefinition"),
                         line == 0 ? _("zero") : _("non-zero"), line, body);
@@ -24334,8 +24217,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
 
            if ((line == 0 && !at_commandline)
                || (line != 0 && at_commandline))
-             complaint (&symfile_complaints,
-                        _("debug info gives source %d included "
+             complaint (_("debug info gives source %d included "
                           "from %s at %s line %d"),
                         file, at_commandline ? _("command-line") : _("file"),
                         line == 0 ? _("zero") : _("non-zero"), line);
@@ -24353,8 +24235,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
 
         case DW_MACRO_end_file:
           if (! current_file)
-           complaint (&symfile_complaints,
-                      _("macro debug info has an unmatched "
+           complaint (_("macro debug info has an unmatched "
                         "`close_file' directive"));
           else
             {
@@ -24381,8 +24262,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
                    = (enum dwarf_macro_record_type) read_1_byte (abfd,
                                                                  mac_ptr);
                   if (next_type != 0)
-                   complaint (&symfile_complaints,
-                              _("no terminating 0-type entry for "
+                   complaint (_("no terminating 0-type entry for "
                                 "macros in `.debug_macinfo' section"));
 
                   return;
@@ -24423,8 +24303,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
              {
                /* This has actually happened; see
                   http://sourceware.org/bugzilla/show_bug.cgi?id=13568.  */
-               complaint (&symfile_complaints,
-                          _("recursive DW_MACRO_import in "
+               complaint (_("recursive DW_MACRO_import in "
                             ".debug_macro section"));
              }
            else
@@ -24519,7 +24398,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
   dwarf2_read_section (objfile, section);
   if (section->buffer == NULL)
     {
-      complaint (&symfile_complaints, _("missing %s section"), section_name);
+      complaint (_("missing %s section"), section_name);
       return;
     }
   abfd = get_section_bfd_owner (section);
@@ -24817,8 +24696,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
       fill_in_loclist_baton (cu, baton, attr);
 
       if (cu->base_known == 0)
-       complaint (&symfile_complaints,
-                  _("Location list used without "
+       complaint (_("Location list used without "
                     "specifying the CU base address."));
 
       SYMBOL_ACLASS_INDEX (sym) = (is_block
@@ -25235,8 +25113,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
     }
   else if (attr != NULL)
     {
-      complaint (&symfile_complaints,
-                _("DW_AT_allocated has the wrong form (%s) at DIE %s"),
+      complaint (_("DW_AT_allocated has the wrong form (%s) at DIE %s"),
                 (attr != NULL ? dwarf_form_name (attr->form) : "n/a"),
                 sect_offset_str (die->sect_off));
     }
@@ -25250,8 +25127,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
     }
   else if (attr != NULL)
     {
-      complaint (&symfile_complaints,
-                _("DW_AT_associated has the wrong form (%s) at DIE %s"),
+      complaint (_("DW_AT_associated has the wrong form (%s) at DIE %s"),
                 (attr != NULL ? dwarf_form_name (attr->form) : "n/a"),
                 sect_offset_str (die->sect_off));
     }
@@ -25279,8 +25155,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
   slot = (struct dwarf2_per_cu_offset_and_type **)
     htab_find_slot (dwarf2_per_objfile->die_type_hash, &ofs, INSERT);
   if (*slot)
-    complaint (&symfile_complaints,
-              _("A problem internal to GDB: DIE %s has type already set"),
+    complaint (_("A problem internal to GDB: DIE %s has type already set"),
               sect_offset_str (die->sect_off));
   *slot = XOBNEW (&objfile->objfile_obstack,
                  struct dwarf2_per_cu_offset_and_type);
This page took 0.058746 seconds and 4 git commands to generate.