From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58647 invoked by alias); 30 Jun 2016 14:09:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 58532 invoked by uid 89); 30 Jun 2016 14:09:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=prev X-HELO: mail-pa0-f65.google.com Received: from mail-pa0-f65.google.com (HELO mail-pa0-f65.google.com) (209.85.220.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 30 Jun 2016 14:09:41 +0000 Received: by mail-pa0-f65.google.com with SMTP id hf6so7285370pac.2 for ; Thu, 30 Jun 2016 07:09:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5HCHaMo/RHtzUfE7+bhkV1hnpBPbF7gPumIbTTj+boY=; b=YSfdhaFnboy5zeD9Y1UOsjKT2MPrielMEZMzQsyuaXyoNh17GVe2KiDv3NeK5phVB5 dEvFkCViC5pKu5E5VSAVIws8tSj8VDxyhnfouO8RQb+L/7hUJx8j4+mLMddn0FuGOdSm e/5f1ow9TBw2upU7bFTtAkcSkd/pbnlLei/UN5amfpmbXygNvXvqA6whYGvIDguNmmN0 Xhw+WroFK+sgav9hv9SnAiBWz3yqgAfgOGgCLtEIhTOAUADyMblpBHo5YhHGxXVm59B3 tPiS6cEBR/Qta3JS4nnR4jjjnOj/DsBGPuvlx+0g2NH78KYKkAFIgu7q4vpwdxkV/EWU LN7Q== X-Gm-Message-State: ALyK8tIcOFeh16EdDW86xshaJJM632WNzPtSuQ9lom0+SYxQ1YR+8TxZLZ2tlWV/5Diq4Q== X-Received: by 10.66.235.163 with SMTP id un3mr21405137pac.93.1467295779805; Thu, 30 Jun 2016 07:09:39 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id s3sm6263184pfb.87.2016.06.30.07.09.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 07:09:39 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 6/9] Use enqueue_pending_signal in linux_resume_one_thread Date: Thu, 30 Jun 2016 14:09:00 -0000 Message-Id: <1467295765-3457-7-git-send-email-yao.qi@linaro.org> In-Reply-To: <1467295765-3457-1-git-send-email-yao.qi@linaro.org> References: <1467295765-3457-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00541.txt.bz2 gdb/gdbserver: 2016-06-29 Yao Qi * linux-low.c (linux_resume_one_thread): Call enqueue_pending_signal. --- gdb/gdbserver/linux-low.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 941b0e8..8061758 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4917,21 +4917,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); } } -- 1.9.1