Index: gdb/progspace.c |
diff --git a/gdb/progspace.c b/gdb/progspace.c |
index 7175fa6ab175b6adfc2beaf562437b1e085e7e8b..1065c277b9207c09b897a80f40fa6a5713e8b348 100644 |
--- a/gdb/progspace.c |
+++ b/gdb/progspace.c |
@@ -149,6 +149,7 @@ release_program_space (struct program_space *pspace) |
free_address_space (pspace->aspace); |
resize_section_table (&pspace->target_sections, |
-resize_section_table (&pspace->target_sections, 0)); |
+ clear_program_space_solib_cache (pspace); |
/* Discard any data modules have associated with the PSPACE. */ |
program_space_free_data (pspace); |
xfree (pspace); |
@@ -503,6 +504,19 @@ switch_to_program_space_and_thread (struct program_space *pspace) |
+/* See progspace.h. */ |
+ |
+void |
+clear_program_space_solib_cache (struct program_space *pspace) |
+{ |
+ VEC_free (so_list_ptr, pspace->added_solibs); |
+ |
+ free_char_ptr_vec (pspace->deleted_solibs); |
+ pspace->deleted_solibs = NULL; |
+} |
+ |
+ |
+ |
/* Keep a registry of per-program_space data-pointers required by other GDB |
modules. */ |