* infrun.c (prepare_for_detach): In non-stop, context switch to

the thread that got the event before handling the event.
This commit is contained in:
Pedro Alves 2010-05-01 15:56:52 +00:00
parent 1e7fc18c9c
commit 4d53310308
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2010-05-01 Pedro Alves <pedro@codesourcery.com>
* infrun.c (prepare_for_detach): In non-stop, context switch to
the thread that got the event before handling the event.
2010-04-30 Tom Tromey <tromey@redhat.com>
* symtab.c (symbol_set_names): Fix typo.

View file

@ -2368,6 +2368,14 @@ prepare_for_detach (void)
state. */
old_chain_2 = make_cleanup (finish_thread_state_cleanup, &minus_one_ptid);
/* In non-stop mode, each thread is handled individually.
Switch early, so the global state is set correctly for this
thread. */
if (non_stop
&& ecs->ws.kind != TARGET_WAITKIND_EXITED
&& ecs->ws.kind != TARGET_WAITKIND_SIGNALLED)
context_switch (ecs->ptid);
/* Now figure out what to do with the result of the result. */
handle_inferior_event (ecs);