aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-07-03 17:38:08 +0000
committerPedro Alves <palves@redhat.com>2008-07-03 17:38:08 +0000
commitdc177b7a5114d1d8385ee3706188aa4e4f675676 (patch)
tree2a6c70e2e00c8e50a75a2dcc03696a8e760a1463 /gdb/infcmd.c
parentcaac88966e74e80449233ec8bc82d9616896a4fa (diff)
downloadgdb-dc177b7a5114d1d8385ee3706188aa4e4f675676.zip
gdb-dc177b7a5114d1d8385ee3706188aa4e4f675676.tar.gz
gdb-dc177b7a5114d1d8385ee3706188aa4e4f675676.tar.bz2
* config/i386/nm-cygwin.h (ATTACH_NO_WAIT): Delete.
* config/i386/nm-i386gnu.h (ATTACH_NO_WAIT): Delete. * target.h (struct target_ops): Add to_attach_no_wait member. (target_attach_no_wait): New. * target.c (update_current_target): Inherit to_attach_no_wait. * infcmd.c: Replace ATTACH_NO_WAIT compile time check by target_attach_no_wait runtime check. * gnu-nat.c (init_gnu_ops): Set to_attach_no_wait in gnu_ops. * win32-nat.c (init_win32_ops): Set to_attach_no_wait in win32_ops.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index d9c9cb7..fead6d1 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -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);
}