diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0db5c46f6c..70c461a4b3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-04-21 Pedro Alves + Rajendra SY + + * inf-ptrace.c (inf_ptrace_attach): Mark the thread as executing. + * remote.c (extended_remote_attach): In all-stop mode, mark the + thread as executing. + 2018-04-19 Philippe Waroquiers * thread.c (thread_apply_all_command): Fix comment. diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index e20388658f..942494bbda 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -235,7 +235,10 @@ inf_ptrace_attach (struct target_ops *ops, const char *args, int from_tty) /* Always add a main thread. If some target extends the ptrace target, it should decorate the ptid later with more info. */ - add_thread_silent (inferior_ptid); + thread_info *thr = add_thread_silent (inferior_ptid); + /* Don't consider the thread stopped until we've processed its + initial SIGSTOP stop. */ + set_executing (thr->ptid, true); unpusher.release (); } diff --git a/gdb/remote.c b/gdb/remote.c index f54a38833b..49013848d5 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5316,7 +5316,10 @@ extended_remote_attach (struct target_ops *target, const char *args, inferior_ptid = remote_current_thread (inferior_ptid); /* Add the main thread to the thread list. */ - add_thread_silent (inferior_ptid); + thread_info *thr = add_thread_silent (inferior_ptid); + /* Don't consider the thread stopped until we've processed the + saved stop reply. */ + set_executing (thr->ptid, true); } /* Next, if the target can specify a description, read it. We do