if an error occurs during symbol reading. */
gdb::optional<clear_symtab_users_cleanup> defer_clear_users;
- std::unique_ptr<struct objfile> objfile_holder (objfile);
+ objfile_up objfile_holder (objfile);
/* If ADDRS is NULL, put together a dummy address list.
We now establish the convention that an addr of zero means
if (symfile_objfile != NULL)
{
- delete symfile_objfile;
+ symfile_objfile->unlink ();
gdb_assert (symfile_objfile == NULL);
}
if (mainline)
flags |= OBJF_MAINLINE;
- objfile = new struct objfile (abfd, name, flags);
-
- if (parent)
- add_separate_debug_objfile (objfile, parent);
+ objfile = objfile::make (abfd, name, flags, parent);
/* We either created a new mapped symbol table, mapped an existing
symbol table file which has not had initial symbol reading
objfile_name (objf)))
error (_("Not confirmed."));
- delete objf;
+ objf->unlink ();
clear_symtab_users (0);
}
/* If we get an error, blow away this objfile (not sure if
that is the correct response for things like shared
libraries). */
- std::unique_ptr<struct objfile> objfile_holder (objfile);
+ objfile_up objfile_holder (objfile);
/* We need to do this whenever any symbols go away. */
clear_symtab_users_cleanup defer_clear_users (0);