This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Use enqueue_pending_signal in linux_resume_one_thread


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4281b351bfa3b646ab531cf73c56e49366fef108

commit 4281b351bfa3b646ab531cf73c56e49366fef108
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Jul 21 12:12:18 2016 +0100

    Use enqueue_pending_signal in linux_resume_one_thread
    
    gdb/gdbserver:
    
    2016-07-21  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-low.c (linux_resume_one_thread): Call
    	enqueue_pending_signal.

Diff:
---
 gdb/gdbserver/ChangeLog   |  5 +++++
 gdb/gdbserver/linux-low.c | 20 +++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 867a5a2..3130334 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
 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.
 	* inferiors.c (do_restore_current_thread_cleanup): New function.
 	(make_cleanup_restore_current_thread): Likewise.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 9c675a4..c8d0266 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -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);
 	}
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]