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;
}
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;
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;
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);
}
/* 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);
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. */
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";
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);
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)