* dwarf2read.c (macro_start_file): Update.
[deliverable/binutils-gdb.git] / gdb / symfile.c
index e1d5c15d4124e3b2972ebbf4e6166f330e6d5e17..6c93ba6dcdb27af235fd6d2454c54f4bd1e21345 100644 (file)
@@ -1208,8 +1208,7 @@ symbol_file_add (char *name, int add_flags, struct section_addr_info *addrs,
   struct cleanup *cleanup = make_cleanup_bfd_unref (bfd);
   struct objfile *objf;
 
-  objf = symbol_file_add_from_bfd (symfile_bfd_open (name), add_flags, addrs,
-                                   flags, NULL);
+  objf = symbol_file_add_from_bfd (bfd, add_flags, addrs, flags, NULL);
   do_cleanups (cleanup);
   return objf;
 }
@@ -1353,7 +1352,7 @@ separate_debug_file_exists (const char *name, unsigned long crc,
   if (filename_cmp (name, parent_objfile->name) == 0)
     return 0;
 
-  abfd = bfd_open_maybe_remote (name);
+  abfd = gdb_bfd_open_maybe_remote (name);
 
   if (!abfd)
     return 0;
@@ -1697,7 +1696,7 @@ set_initial_language (void)
    returns NULL with the BFD error set.  */
 
 bfd *
-bfd_open_maybe_remote (const char *name)
+gdb_bfd_open_maybe_remote (const char *name)
 {
   bfd *result;
 
@@ -2516,7 +2515,7 @@ reread_symbols (void)
            obfd_filename = bfd_get_filename (objfile->obfd);
            /* Open the new BFD before freeing the old one, so that
               the filename remains live.  */
-           objfile->obfd = bfd_open_maybe_remote (obfd_filename);
+           objfile->obfd = gdb_bfd_open_maybe_remote (obfd_filename);
            gdb_bfd_unref (obfd);
          }
 
@@ -2549,10 +2548,6 @@ reread_symbols (void)
          /* Free the obstacks for non-reusable objfiles.  */
          psymbol_bcache_free (objfile->psymbol_cache);
          objfile->psymbol_cache = psymbol_bcache_init ();
-         bcache_xfree (objfile->macro_cache);
-         objfile->macro_cache = bcache_xmalloc (NULL, NULL);
-         bcache_xfree (objfile->filename_cache);
-         objfile->filename_cache = bcache_xmalloc (NULL,NULL);
          if (objfile->demangled_names_hash != NULL)
            {
              htab_delete (objfile->demangled_names_hash);
@@ -2573,6 +2568,8 @@ reread_symbols (void)
          memset (&objfile->msymbol_demangled_hash, 0,
                  sizeof (objfile->msymbol_demangled_hash));
 
+         set_objfile_per_bfd (objfile);
+
          /* obstack_init also initializes the obstack so it is
             empty.  We could use obstack_specify_allocation but
             gdb_obstack.h specifies the alloc/dealloc functions.  */
@@ -2857,7 +2854,7 @@ allocate_symtab (const char *filename, struct objfile *objfile)
     obstack_alloc (&objfile->objfile_obstack, sizeof (struct symtab));
   memset (symtab, 0, sizeof (*symtab));
   symtab->filename = (char *) bcache (filename, strlen (filename) + 1,
-                                     objfile->filename_cache);
+                                     objfile->per_bfd->filename_cache);
   symtab->fullname = NULL;
   symtab->language = deduce_language_from_filename (filename);
   symtab->debugformat = "unknown";
@@ -2884,8 +2881,8 @@ allocate_symtab (const char *filename, struct objfile *objfile)
                              last_objfile_name);
        }
       fprintf_unfiltered (gdb_stdlog,
-                         "Created symtab 0x%lx for module %s.\n",
-                         (long) symtab, filename);
+                         "Created symtab %s for module %s.\n",
+                         host_address_to_string (symtab), filename);
     }
 
   return (symtab);
@@ -3394,7 +3391,7 @@ overlay_load_command (char *args, int from_tty)
    A place-holder for a mis-typed command.  */
 
 /* Command list chain containing all defined "overlay" subcommands.  */
-struct cmd_list_element *overlaylist;
+static struct cmd_list_element *overlaylist;
 
 static void
 overlay_command (char *args, int from_tty)
This page took 0.025309 seconds and 4 git commands to generate.