aboutsummaryrefslogtreecommitdiff
path: root/gdb/inferior.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/inferior.c
parent0560c645c02eba2828a053039dcfdf676cdd1d00 (diff)
downloadgdb-ef3f321b39c3e31fc49f034257a944d515af182a.zip
gdb-ef3f321b39c3e31fc49f034257a944d515af182a.tar.gz
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/inferior.c')
-rw-r--r--gdb/inferior.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 5e98df5..d0783d3 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -184,8 +184,11 @@ delete_thread_of_inferior (struct thread_info *tp, void *data)
return 0;
}
+/* If SILENT then be quiet -- don't announce a inferior death, or the
+ exit of its threads. */
+
void
-delete_inferior (struct inferior *todel)
+delete_inferior_1 (struct inferior *todel, int silent)
{
struct inferior *inf, *infprev;
struct delete_thread_of_inferior_arg arg;
@@ -200,7 +203,7 @@ delete_inferior (struct inferior *todel)
return;
arg.pid = inf->pid;
- arg.silent = 1;
+ arg.silent = silent;
iterate_over_threads (delete_thread_of_inferior, &arg);
@@ -211,13 +214,29 @@ delete_inferior (struct inferior *todel)
observer_notify_inferior_removed (inf);
- /* If this program space is rendered useless, remove it. */
- if (program_space_empty_p (inf->pspace))
- delete_program_space (inf->pspace);
-
free_inferior (inf);
}
+void
+delete_inferior (int pid)
+{
+ struct inferior *inf = find_inferior_pid (pid);
+
+ delete_inferior_1 (inf, 0);
+
+ if (print_inferior_events)
+ printf_unfiltered (_("[Inferior %d exited]\n"), pid);
+}
+
+void
+delete_inferior_silent (int pid)
+{
+ struct inferior *inf = find_inferior_pid (pid);
+
+ delete_inferior_1 (inf, 1);
+}
+
+
/* If SILENT then be quiet -- don't announce a inferior exit, or the
exit of its threads. */
@@ -490,9 +509,11 @@ prune_inferiors (void)
}
*ss_link = ss->next;
- delete_inferior (ss);
+ delete_inferior_1 (ss, 1);
ss = *ss_link;
}
+
+ prune_program_spaces ();
}
/* Simply returns the count of inferiors. */
@@ -776,8 +797,10 @@ remove_inferior_command (char *args, int from_tty)
continue;
}
- delete_inferior (inf);
+ delete_inferior_1 (inf, 1);
}
+
+ prune_program_spaces ();
}
struct inferior *