aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 70f4c08..b83066c 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1499,10 +1499,8 @@ detach_callback (struct lwp_info *lp, void *data)
static void
linux_nat_detach (struct target_ops *ops, inferior *inf, int from_tty)
{
- int pid;
struct lwp_info *main_lwp;
-
- pid = ptid_get_pid (inferior_ptid);
+ int pid = inf->pid;
/* Don't unregister from the event loop, as there may be other
inferiors running. */
@@ -1517,7 +1515,7 @@ linux_nat_detach (struct target_ops *ops, inferior *inf, int from_tty)
iterate_over_lwps (pid_to_ptid (pid), detach_callback, NULL);
/* Only the initial process should be left right now. */
- gdb_assert (num_lwps (ptid_get_pid (inferior_ptid)) == 1);
+ gdb_assert (num_lwps (pid) == 1);
main_lwp = find_lwp_pid (pid_to_ptid (pid));
@@ -1538,7 +1536,7 @@ linux_nat_detach (struct target_ops *ops, inferior *inf, int from_tty)
detach_one_lwp (main_lwp, &signo);
- inf_ptrace_detach_success (ops);
+ inf_ptrace_detach_success (ops, inf);
}
}