X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fprogspace.c;h=e6c4f55c4e8b1c39dda555ff7a019d3ec84f4a89;hb=234529260a90b6ac6ed38ddac45d6ed15149e8f8;hp=5aa7a3d177e488a24c218e8ba617dbf78b84df62;hpb=7cac64af7bc6a7f7a86f90a1465f7c3d2b6f07e8;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/progspace.c b/gdb/progspace.c index 5aa7a3d177..e6c4f55c4e 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -175,6 +175,31 @@ program_space::add_objfile (struct objfile *objfile, struct objfile *before) } +/* See progspace.h. */ + +void +program_space::remove_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; + + if (objfile == symfile_object_file) + symfile_object_file = NULL; + + return; + } + } + + internal_error (__FILE__, __LINE__, + _("remove_objfile: objfile already unlinked")); +} + /* Copies program space SRC to DEST. Copies the main executable file, and the main symbol file. Returns DEST. */