]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/infcmd.c
* config/i386/nm-cygwin.h (ATTACH_NO_WAIT): Delete.
[thirdparty/binutils-gdb.git] / gdb / infcmd.c
index d9c9cb758340cd8c9eb17209c77f85e195138d28..fead6d16a7aa8cd953d48325495c4ef6aadc8f4e 100644 (file)
@@ -2015,38 +2015,40 @@ attach_command (char *args, int from_tty)
   init_wait_for_inferior ();
   clear_proceed_status ();
 
-  /* No traps are generated when attaching to inferior under Mach 3
-     or GNU hurd.  */
-#ifndef ATTACH_NO_WAIT
-  /* Careful here. See comments in inferior.h.  Basically some OSes
-     don't ignore SIGSTOPs on continue requests anymore.  We need a
-     way for handle_inferior_event to reset the stop_signal variable
-     after an attach, and this is what STOP_QUIETLY_NO_SIGSTOP is for.  */
-  stop_soon = STOP_QUIETLY_NO_SIGSTOP;
-
-  if (target_can_async_p ())
+  /* Some system don't generate traps when attaching to inferior.
+     E.g. Mach 3 or GNU hurd.  */
+  if (!target_attach_no_wait)
     {
-      /* sync_execution mode.  Wait for stop.  */
-      struct continuation_arg *arg1, *arg2, *arg3;
+      /* Careful here. See comments in inferior.h.  Basically some
+        OSes don't ignore SIGSTOPs on continue requests anymore.  We
+        need a way for handle_inferior_event to reset the stop_signal
+        variable after an attach, and this is what
+        STOP_QUIETLY_NO_SIGSTOP is for.  */
+      stop_soon = STOP_QUIETLY_NO_SIGSTOP;
 
-      arg1 =
-       (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg2 =
-       (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg3 =
-       (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg1->next = arg2;
-      arg2->next = arg3;
-      arg3->next = NULL;
-      arg1->data.pointer = args;
-      arg2->data.integer = from_tty;
-      arg3->data.integer = async_exec;
-      add_continuation (attach_command_continuation, arg1);
-      return;
-    }
+      if (target_can_async_p ())
+       {
+         /* sync_execution mode.  Wait for stop.  */
+         struct continuation_arg *arg1, *arg2, *arg3;
+
+         arg1 =
+           (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+         arg2 =
+           (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+         arg3 =
+           (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
+         arg1->next = arg2;
+         arg2->next = arg3;
+         arg3->next = NULL;
+         arg1->data.pointer = args;
+         arg2->data.integer = from_tty;
+         arg3->data.integer = async_exec;
+         add_continuation (attach_command_continuation, arg1);
+         return;
+       }
 
-  wait_for_inferior (0);
-#endif
+      wait_for_inferior (0);
+    }
 
   attach_command_post_wait (args, from_tty, async_exec);
 }