Use enqueue_pending_signal in linux_resume_one_thread
authorYao Qi <yao.qi@linaro.org>
Thu, 21 Jul 2016 11:12:18 +0000 (12:12 +0100)
committerYao Qi <yao.qi@linaro.org>
Thu, 21 Jul 2016 11:12:18 +0000 (12:12 +0100)
gdb/gdbserver:

2016-07-21  Yao Qi  <yao.qi@linaro.org>

* linux-low.c (linux_resume_one_thread): Call
enqueue_pending_signal.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c

index 867a5a29f2f2a303d9bab0d702268ac6d30f45e5..3130334dd7cc646192ea159abd78fe536e104ad9 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-21  Yao Qi  <yao.qi@linaro.org>
+
+       * linux-low.c (linux_resume_one_thread): Call
+       enqueue_pending_signal.
+
 2016-07-21  Yao Qi  <yao.qi@linaro.org>
 
        * gdbthread.h (make_cleanup_restore_current_thread): Declare.
index 9c675a42611a905f10d2eadca41828c613fd41f2..c8d0266e465ba623dabb2a67a928db1aaef3e8ec 100644 (file)
@@ -4995,21 +4995,19 @@ linux_resume_one_thread (struct inferior_list_entry *entry, void *arg)
       /* If we have a new signal, enqueue the signal.  */
       if (lwp->resume->sig != 0)
        {
-         struct pending_signals *p_sig = XCNEW (struct pending_signals);
-
-         p_sig->prev = lwp->pending_signals;
-         p_sig->signal = lwp->resume->sig;
+         siginfo_t info, *info_p;
 
          /* If this is the same signal we were previously stopped by,
-            make sure to queue its siginfo.  We can ignore the return
-            value of ptrace; if it fails, we'll skip
-            PTRACE_SETSIGINFO.  */
+            make sure to queue its siginfo.  */
          if (WIFSTOPPED (lwp->last_status)
-             && WSTOPSIG (lwp->last_status) == lwp->resume->sig)
-           ptrace (PTRACE_GETSIGINFO, lwpid_of (thread), (PTRACE_TYPE_ARG3) 0,
-                   &p_sig->info);
+             && WSTOPSIG (lwp->last_status) == lwp->resume->sig
+             && ptrace (PTRACE_GETSIGINFO, lwpid_of (thread),
+                        (PTRACE_TYPE_ARG3) 0, &info) == 0)
+           info_p = &info;
+         else
+           info_p = NULL;
 
-         lwp->pending_signals = p_sig;
+         enqueue_pending_signal (lwp, lwp->resume->sig, info_p);
        }
     }
 
This page took 0.035707 seconds and 4 git commands to generate.