From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42672 invoked by alias); 26 Sep 2017 16:52:09 -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 42438 invoked by uid 89); 26 Sep 2017 16:52:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS,TRACKER_ID autolearn=no version=3.3.2 spammy= 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 ESMTP; Tue, 26 Sep 2017 16:52:08 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D177C7E426 for ; Tue, 26 Sep 2017 16:52:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D177C7E426 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj@redhat.com Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB60F413C; Tue, 26 Sep 2017 16:52:06 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [PATCH v2] Use "switch_to_thread" more thoroughly on gdbserver References: <20170915043357.26094-1-sergiodj@redhat.com> <20170926042239.30748-1-sergiodj@redhat.com> Date: Tue, 26 Sep 2017 16:52:00 -0000 In-Reply-To: (Pedro Alves's message of "Tue, 26 Sep 2017 13:28:26 +0100") Message-ID: <87ing5iert.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00808.txt.bz2 On Tuesday, September 26 2017, Pedro Alves wrote: > On 09/26/2017 05:22 AM, Sergio Durigan Junior wrote: > >> gdb/gdbserver/ChangeLog: >> yyyy-mm-dd Sergio Durigan Junior >> >> * gdbthread.h: Include "common-gdbthread.h". >> * inferiors.c (switch_to_thread): Use "gdb_assert" instead of >> "if" when validating the ptid. >> * remote-utils.c: Include "gdbthread.h". >> (prepare_resume_reply): Use "switch_to_thread". >> * target.c (done_accessing_memory): Likewise. > > OK > >> void >> switch_to_thread (ptid_t ptid) >> { >> - if (!ptid_equal (ptid, minus_one_ptid)) >> - current_thread = find_thread_ptid (ptid); >> + gdb_assert (!ptid_equal (ptid, minus_one_ptid)); > > Note you can write: > > gdb_assert (ptid != minus_one_ptid); > > nowadays. That's right; pushed with this small nit fixed. 75352e283fb2b265d14c750859156943f6eb2693 Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/