Move free_all_objfiles to program_space
[deliverable/binutils-gdb.git] / gdb / progspace.c
index d1bf0c6aba3dd5a546661da210101d05fa572f27..3cb0d4c61e3966eb571e18b92fdb7a0fa0c8906a 100644 (file)
@@ -23,6 +23,7 @@
 #include "arch-utils.h"
 #include "gdbcore.h"
 #include "solib.h"
+#include "solist.h"
 #include "gdbthread.h"
 #include "inferior.h"
 #include <algorithm>
@@ -156,6 +157,23 @@ program_space::~program_space ()
 
 /* See progspace.h.  */
 
+void
+program_space::free_all_objfiles ()
+{
+  struct so_list *so;
+
+  /* Any objfile reference would become stale.  */
+  for (so = master_so_list (); so; so = so->next)
+    gdb_assert (so->objfile == NULL);
+
+  while (!objfiles_list.empty ())
+    objfiles_list.front ()->unlink ();
+
+  clear_symtab_users (0);
+}
+
+/* See progspace.h.  */
+
 void
 program_space::add_objfile (struct objfile *objfile, struct objfile *before)
 {
This page took 0.023173 seconds and 4 git commands to generate.