gdb/fortran: Introduce fortran-operator.def file
[deliverable/binutils-gdb.git] / gdb / dwarf-index-write.c
index f1118f722c56dcec7c19ba9414cadf2fb6047770..3f96ffdafb628bd297052daea3282afe37ce5a00 100644 (file)
@@ -474,8 +474,8 @@ write_address_map (struct objfile *objfile, data_buf &addr_vec,
   addrmap_index_data.objfile = objfile;
   addrmap_index_data.previous_valid = 0;
 
-  addrmap_foreach (objfile->psymtabs_addrmap, add_address_entry_worker,
-                  &addrmap_index_data);
+  addrmap_foreach (objfile->partial_symtabs->psymtabs_addrmap,
+                  add_address_entry_worker, &addrmap_index_data);
 
   /* It's highly unlikely the last entry (end address = 0xff...ff)
      is valid, but we should still handle it.
@@ -582,13 +582,13 @@ write_one_signatured_type (void **slot, void *d)
 
   write_psymbols (info->symtab,
                  info->psyms_seen,
-                 (info->objfile->global_psymbols.data ()
+                 (info->objfile->partial_symtabs->global_psymbols.data ()
                   + psymtab->globals_offset),
                  psymtab->n_global_syms, info->cu_index,
                  0);
   write_psymbols (info->symtab,
                  info->psyms_seen,
-                 (info->objfile->static_psymbols.data ()
+                 (info->objfile->partial_symtabs->static_psymbols.data ()
                   + psymtab->statics_offset),
                  psymtab->n_static_syms, info->cu_index,
                  1);
@@ -639,12 +639,14 @@ recursively_write_psymbols (struct objfile *objfile,
 
   write_psymbols (symtab,
                  psyms_seen,
-                 objfile->global_psymbols.data () + psymtab->globals_offset,
+                 (objfile->partial_symtabs->global_psymbols.data ()
+                  + psymtab->globals_offset),
                  psymtab->n_global_syms, cu_index,
                  0);
   write_psymbols (symtab,
                  psyms_seen,
-                 objfile->static_psymbols.data () + psymtab->statics_offset,
+                 (objfile->partial_symtabs->static_psymbols.data ()
+                  + psymtab->statics_offset),
                  psymtab->n_static_syms, cu_index,
                  1);
 }
@@ -835,10 +837,12 @@ public:
                                    psyms_seen, cu_index);
 
     write_psymbols (psyms_seen,
-                   objfile->global_psymbols.data () + psymtab->globals_offset,
+                   (objfile->partial_symtabs->global_psymbols.data ()
+                    + psymtab->globals_offset),
                    psymtab->n_global_syms, cu_index, false, unit_kind::cu);
     write_psymbols (psyms_seen,
-                   objfile->static_psymbols.data () + psymtab->statics_offset,
+                   (objfile->partial_symtabs->static_psymbols.data ()
+                    + psymtab->statics_offset),
                    psymtab->n_static_syms, cu_index, true, unit_kind::cu);
   }
 
@@ -1195,12 +1199,12 @@ private:
     struct partial_symtab *psymtab = entry->per_cu.v.psymtab;
 
     write_psymbols (info->psyms_seen,
-                   (info->objfile->global_psymbols.data ()
+                   (info->objfile->partial_symtabs->global_psymbols.data ()
                     + psymtab->globals_offset),
                    psymtab->n_global_syms, info->cu_index, false,
                    unit_kind::tu);
     write_psymbols (info->psyms_seen,
-                   (info->objfile->static_psymbols.data ()
+                   (info->objfile->partial_symtabs->static_psymbols.data ()
                     + psymtab->statics_offset),
                    psymtab->n_static_syms, info->cu_index, true,
                    unit_kind::tu);
@@ -1554,7 +1558,8 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
   if (VEC_length (dwarf2_section_info_def, dwarf2_per_objfile->types) > 1)
     error (_("Cannot make an index when the file has multiple .debug_types sections"));
 
-  if (!objfile->psymtabs || !objfile->psymtabs_addrmap)
+  if (!objfile->partial_symtabs->psymtabs
+      || !objfile->partial_symtabs->psymtabs_addrmap)
     return;
 
   struct stat st;
@@ -1657,7 +1662,7 @@ save_gdb_index_command (const char *arg, int from_tty)
   if (!*arg)
     error (_("usage: save gdb-index [-dwarf-5] DIRECTORY"));
 
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       struct stat st;
 
@@ -1670,19 +1675,18 @@ save_gdb_index_command (const char *arg, int from_tty)
 
       if (dwarf2_per_objfile != NULL)
        {
-         TRY
+         try
            {
              const char *basename = lbasename (objfile_name (objfile));
              write_psymtabs_to_index (dwarf2_per_objfile, arg, basename,
                                       index_kind);
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_error &except)
            {
              exception_fprintf (gdb_stderr, except,
                                 _("Error while writing index for `%s': "),
                                 objfile_name (objfile));
            }
-         END_CATCH
            }
 
     }
This page took 0.026464 seconds and 4 git commands to generate.