diff options
Diffstat (limited to 'gdb/progspace.c')
-rw-r--r-- | gdb/progspace.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/progspace.c b/gdb/progspace.c index 5aa7a3d..e6c4f55 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. */ |