]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/inf-ptrace.c
Allow making GDB not automatically connect to the native target.
[thirdparty/binutils-gdb.git] / gdb / inf-ptrace.c
index bffb4bac0311bcf5585bd49bfa6341309ce12a62..cc4921bda4ec37716b049556cf874a0b9fa26038 100644 (file)
@@ -176,8 +176,7 @@ inf_ptrace_mourn_inferior (struct target_ops *ops)
 
   generic_mourn_inferior ();
 
-  if (!have_inferiors ())
-    unpush_target (ops);
+  inf_child_maybe_unpush_target (ops);
 }
 
 /* Attach to the process specified by ARGS.  If FROM_TTY is non-zero,
@@ -297,8 +296,7 @@ inf_ptrace_detach (struct target_ops *ops, const char *args, int from_tty)
   inferior_ptid = null_ptid;
   detach_inferior (pid);
 
-  if (!have_inferiors ())
-    unpush_target (ops);
+  inf_child_maybe_unpush_target (ops);
 }
 
 /* Kill the inferior.  */