From: Pedro Alves Date: Sat, 1 May 2010 15:56:52 +0000 (+0000) Subject: * infrun.c (prepare_for_detach): In non-stop, context switch to X-Git-Tag: sid-snapshot-20100601~334 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d53310308f52cff5131a2d9a8012fe60f6ee2f8;p=external%2Fbinutils.git * infrun.c (prepare_for_detach): In non-stop, context switch to the thread that got the event before handling the event. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f13b2a8..9092177 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-05-01 Pedro Alves + + * 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 * symtab.c (symbol_set_names): Fix typo. diff --git a/gdb/infrun.c b/gdb/infrun.c index 5882cb8..93f50eb 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -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);