Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / symfile.c
index 12746c4337478b900d44c0621af9c4123b3bc695..673451148523420e7c2abd6c531c7e3531cf11b5 100644 (file)
@@ -69,8 +69,6 @@
 #include <chrono>
 #include <algorithm>
 
-#include "psymtab.h"
-
 int (*deprecated_ui_load_progress_hook) (const char *section,
                                         unsigned long num);
 void (*deprecated_show_load_progress) (const char *section,
@@ -793,7 +791,7 @@ read_symbols (struct objfile *objfile, symfile_add_flags add_flags)
        }
     }
   if ((add_flags & SYMFILE_NO_READ) == 0)
-    require_partial_symbols (objfile, false);
+    objfile->require_partial_symbols (false);
 }
 
 /* Initialize entry point information for this objfile.  */
@@ -840,10 +838,8 @@ init_entry_point_info (struct objfile *objfile)
 
       /* Make certain that the address points at real code, and not a
         function descriptor.  */
-      entry_point
-       = gdbarch_convert_from_func_ptr_addr (objfile->arch (),
-                                             entry_point,
-                                             current_top_target ());
+      entry_point = gdbarch_convert_from_func_ptr_addr
+       (objfile->arch (), entry_point, current_inferior ()->top_target ());
 
       /* Remove any ISA markers, so that this matches entries in the
         symbol table.  */
@@ -904,7 +900,7 @@ syms_from_objfile_1 (struct objfile *objfile,
   const int mainline = add_flags & SYMFILE_MAINLINE;
 
   objfile_set_sym_fns (objfile, find_sym_fns (objfile->obfd));
-  objfile->qf = make_psymbol_functions (objfile->partial_symtabs);
+  objfile->qf.clear ();
 
   if (objfile->sf == NULL)
     {
@@ -2522,8 +2518,6 @@ reread_symbols (void)
            error (_("Can't read symbols from %s: %s."), objfile_name (objfile),
                   bfd_errmsg (bfd_get_error ()));
 
-         objfile->reset_psymtabs ();
-
          /* NB: after this call to obstack_free, objfiles_changed
             will need to be called (see discussion below).  */
          obstack_free (&objfile->objfile_obstack, 0);
@@ -2555,7 +2549,7 @@ reread_symbols (void)
             based on whether .gdb_index is present, and we need it to
             start over.  PR symtab/15885  */
          objfile_set_sym_fns (objfile, find_sym_fns (objfile->obfd));
-         objfile->qf = make_psymbol_functions (objfile->partial_symtabs);
+         objfile->qf.clear ();
 
          build_objfile_section_table (objfile);
 
@@ -2776,16 +2770,15 @@ allocate_symtab (struct compunit_symtab *cust, const char *filename)
     {
       /* Be a bit clever with debugging messages, and don't print objfile
         every time, only when it changes.  */
-      static char *last_objfile_name = NULL;
+      static std::string last_objfile_name;
+      const char *this_objfile_name = objfile_name (objfile);
 
-      if (last_objfile_name == NULL
-         || strcmp (last_objfile_name, objfile_name (objfile)) != 0)
+      if (last_objfile_name.empty () || last_objfile_name != this_objfile_name)
        {
-         xfree (last_objfile_name);
-         last_objfile_name = xstrdup (objfile_name (objfile));
+         last_objfile_name = this_objfile_name;
          fprintf_filtered (gdb_stdlog,
                            "Creating one or more symtabs for objfile %s ...\n",
-                           last_objfile_name);
+                           this_objfile_name);
        }
       fprintf_filtered (gdb_stdlog,
                        "Created symtab %s for module %s.\n",
@@ -3743,11 +3736,11 @@ expand_symtabs_matching
    See quick_symbol_functions.map_symbol_filenames for details.  */
 
 void
-map_symbol_filenames (symbol_filename_ftype *fun, void *data,
-                     int need_fullname)
+map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
+                     bool need_fullname)
 {
   for (objfile *objfile : current_program_space->objfiles ())
-    objfile->map_symbol_filenames (fun, data, need_fullname);
+    objfile->map_symbol_filenames (fun, need_fullname);
 }
 
 #if GDB_SELF_TEST
This page took 0.025843 seconds and 4 git commands to generate.