aboutsummaryrefslogtreecommitdiff
path: root/gdb/inferior.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/inferior.c')
-rw-r--r--gdb/inferior.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 0b8f340..38b7369 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -253,10 +253,13 @@ exit_inferior_num_silent (int num)
exit_inferior_1 (inf, 1);
}
+/* See inferior.h. */
+
void
-detach_inferior (int pid)
+detach_inferior (inferior *inf)
{
- struct inferior *inf = find_inferior_pid (pid);
+ /* Save the pid, since exit_inferior_1 will reset it. */
+ int pid = inf->pid;
exit_inferior_1 (inf, 0);
@@ -264,6 +267,14 @@ detach_inferior (int pid)
printf_unfiltered (_("[Inferior %d detached]\n"), pid);
}
+/* See inferior.h. */
+
+void
+detach_inferior (int pid)
+{
+ detach_inferior (find_inferior_pid (pid));
+}
+
void
inferior_appeared (struct inferior *inf, int pid)
{