X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fobjfiles.c;h=56854cc5c63bdf92de7263faad8f492970119134;hb=343cc95202fce70383551053f2efab09c5e02366;hp=b4fb6f2d18c4ec49ddfe6d0018e0d1905fb8ba34;hpb=7cac64af7bc6a7f7a86f90a1465f7c3d2b6f07e8;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/objfiles.c b/gdb/objfiles.c index b4fb6f2d18..56854cc5c6 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -54,6 +54,7 @@ #include "btrace.h" #include "gdbsupport/pathstuff.h" +#include #include /* Keep a registry of per-objfile data-pointers required by other GDB @@ -456,27 +457,6 @@ separate_debug_iterator::operator++ () return *this; } -/* Unlink OBJFILE from the list of known objfiles. */ - -static void -unlink_objfile (struct objfile *objfile) -{ - struct objfile **objpp; - - for (objpp = &object_files; *objpp != NULL; objpp = &((*objpp)->next)) - { - if (*objpp == objfile) - { - *objpp = (*objpp)->next; - objfile->next = NULL; - return; - } - } - - internal_error (__FILE__, __LINE__, - _("unlink_objfile: objfile already unlinked")); -} - /* Add OBJFILE as a separate debug objfile of PARENT. */ static void @@ -519,6 +499,7 @@ objfile::make (bfd *bfd_, const char *name_, objfile_flags flags_, void objfile::unlink () { + current_program_space->remove_objfile (this); delete this; } @@ -609,13 +590,6 @@ objfile::~objfile () else delete per_bfd; - /* Remove it from the chain of all objfiles. */ - - unlink_objfile (this); - - if (this == symfile_objfile) - symfile_objfile = NULL; - /* Before the symbol table code was redone to make it easier to selectively load and remove information particular to a specific linkage unit, gdb used to do these things whenever the monolithic @@ -644,21 +618,6 @@ objfile::~objfile () get_objfile_pspace_data (pspace)->section_map_dirty = 1; } -/* Free all the object files at once and clean up their users. */ - -void -free_all_objfiles (void) -{ - struct so_list *so; - - /* Any objfile reference would become stale. */ - for (so = master_so_list (); so; so = so->next) - gdb_assert (so->objfile == NULL); - - for (objfile *objfile : current_program_space->objfiles_safe ()) - objfile->unlink (); - clear_symtab_users (0); -} /* A helper function for objfile_relocate1 that relocates a single symbol. */