PR 20627: Use resume_stop to stop lwp
authorYao Qi <yao.qi@linaro.org>
Fri, 30 Sep 2016 17:39:12 +0000 (18:39 +0100)
committerYao Qi <yao.qi@linaro.org>
Fri, 30 Sep 2016 17:39:12 +0000 (18:39 +0100)
Commit 049a8570 (Use target_continue{,_no_signal} instead of target_resume)
replaces the code stopping lwp with target_continue_no_signal in
target_stop_and_wait, like this,

-  resume_info.thread = ptid;
-  resume_info.kind = resume_stop;
-  resume_info.sig = GDB_SIGNAL_0;
-  (*the_target->resume) (&resume_info, 1);
+  target_continue_no_signal (ptid);

the replacement is not equivalent, and it causes PR 20627.  This patch
is just to revert that change.

Regression testing it on x86_64-linux.

gdb/gdbserver:

2016-09-30  Yao Qi  <yao.qi@linaro.org>

PR gdbserver/20627
* target.c (target_stop_and_wait): Don't call
target_continue_no_signal, use resume_stop instead.

gdb/gdbserver/ChangeLog
gdb/gdbserver/target.c

index aace87752f204ab6a1b60dc567a975339d9bf23e..5c2cca9f98f600981ab8ec0111d697ebbda1c4ca 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-30  Yao Qi  <yao.qi@linaro.org>
+
+       PR gdbserver/20627
+       * target.c (target_stop_and_wait): Don't call
+       target_continue_no_signal, use resume_stop instead.
+
 2016-09-26  Yao Qi  <yao.qi@linaro.org>
 
        * linux-low.c (linux_wait_1): Call debug_exit.
index cf3da4748300e5f4210054d9ea4cfacee25194e3..fd7c7141db87135f53ed7c70ec5d8590ff54312f 100644 (file)
@@ -248,8 +248,12 @@ target_stop_and_wait (ptid_t ptid)
 {
   struct target_waitstatus status;
   int was_non_stop = non_stop;
+  struct thread_resume resume_info;
 
-  target_continue_no_signal (ptid);
+  resume_info.thread = ptid;
+  resume_info.kind = resume_stop;
+  resume_info.sig = GDB_SIGNAL_0;
+  (*the_target->resume) (&resume_info, 1);
 
   non_stop = 1;
   mywait (ptid, &status, 0, 0);