aboutsummaryrefslogtreecommitdiff
path: root/gdb/progspace.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2015-07-08 11:40:35 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2015-07-08 11:40:35 -0400
commitef3f321b39c3e31fc49f034257a944d515af182a (patch)
tree2e5715e2ac8d9a6b01c21e02516f0f00d5718a07 /gdb/progspace.c
parent0560c645c02eba2828a053039dcfdf676cdd1d00 (diff)
downloadfsf-binutils-gdb-ef3f321b39c3e31fc49f034257a944d515af182a.zip
fsf-binutils-gdb-ef3f321b39c3e31fc49f034257a944d515af182a.tar.gz
fsf-binutils-gdb-ef3f321b39c3e31fc49f034257a944d515af182a.tar.bz2
Revert "Delete program spaces directly when removing inferiors"
Reverted, since it causes a build failure. It turns out that delete_inferior_silent wasn't actually unused. This reverts commit 0560c645c02eba2828a053039dcfdf676cdd1d00.
Diffstat (limited to 'gdb/progspace.c')
-rw-r--r--gdb/progspace.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/gdb/progspace.c b/gdb/progspace.c
index a8f5ea0..1c0a254 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -235,8 +235,8 @@ save_current_program_space (void)
/* Returns true iff there's no inferior bound to PSPACE. */
-int
-program_space_empty_p (struct program_space *pspace)
+static int
+pspace_empty_p (struct program_space *pspace)
{
if (find_inferior_for_program_space (pspace) != NULL)
return 0;
@@ -244,31 +244,30 @@ program_space_empty_p (struct program_space *pspace)
return 1;
}
-/* Remove a program space from the program spaces list and release it. It is
- an error to call this function while PSPACE is the current program space. */
+/* Prune away automatically added program spaces that aren't required
+ anymore. */
void
-delete_program_space (struct program_space *pspace)
+prune_program_spaces (void)
{
struct program_space *ss, **ss_link;
- gdb_assert(pspace != NULL);
- gdb_assert(pspace != current_program_space);
+ struct program_space *current = current_program_space;
ss = program_spaces;
ss_link = &program_spaces;
- while (ss != NULL)
+ while (ss)
{
- if (ss == pspace)
+ if (ss == current || !pspace_empty_p (ss))
{
- *ss_link = ss->next;
- break;
+ ss_link = &ss->next;
+ ss = *ss_link;
+ continue;
}
- ss_link = &ss->next;
+ *ss_link = ss->next;
+ release_program_space (ss);
ss = *ss_link;
}
-
- release_program_space (pspace);
}
/* Prints the list of program spaces and their details on UIOUT. If