From patchwork Mon Aug 24 17:02:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 8410 Received: (qmail 20709 invoked by alias); 24 Aug 2015 17:02:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20671 invoked by uid 89); 24 Aug 2015 17:02:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 24 Aug 2015 17:02:35 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 593B88E25F; Mon, 24 Aug 2015 17:02:34 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7OH2W4T022487; Mon, 24 Aug 2015 13:02:33 -0400 Message-ID: <55DB4E28.3000001@redhat.com> Date: Mon, 24 Aug 2015 18:02:32 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ulrich Weigand CC: gdb-patches@sourceware.org Subject: Re: [PATCH] gdbserver: don't pick a random thread if the current thread dies References: <20150824145933.1A02B1249E@oc7340732750.ibm.com> <55DB3894.7000105@redhat.com> In-Reply-To: <55DB3894.7000105@redhat.com> On 08/24/2015 04:30 PM, Pedro Alves wrote: > I guess lwpid_of would be a little better even. I went ahead a pushed this bit in, like below. Build-tested on the gcc110 ppc64 machine on the GCC compile farm. The fix for the crash will follow. From a8c6d4fcd6b2a30c2b5b87d656ce035dcf8b0035 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 24 Aug 2015 17:58:22 +0100 Subject: [PATCH] Fix gdbserver SPU build Ref: https://sourceware.org/ml/gdb-patches/2015-08/msg00675.html gdbserver/spu-low.c: In function 'spu_request_interrupt': gdbserver/spu-low.c:639: error: incompatible type for argument 1 of 'ptid_get_lwp' gdb/gdbserver/ChangeLog: 2015-08-24 Pedro Alves * spu-low.c (spu_request_interrupt): Use lwpid_of instead of ptid_get_lwp. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/spu-low.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index cd5e046..12d8bb3 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2015-08-24 Pedro Alves + + * spu-low.c (spu_request_interrupt): Use lwpid_of instead of + ptid_get_lwp. + 2015-08-21 Pedro Alves * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c index 2ca9159..a110a0e 100644 --- a/gdb/gdbserver/spu-low.c +++ b/gdb/gdbserver/spu-low.c @@ -636,7 +636,7 @@ spu_request_interrupt (void) { struct thread_info *thr = get_first_thread (); - syscall (SYS_tkill, ptid_get_lwp (thr), SIGINT); + syscall (SYS_tkill, lwpid_of (thr), SIGINT); } static struct target_ops spu_target_ops = {