From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126332 invoked by alias); 22 Feb 2017 21:06:55 -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 126320 invoked by uid 89); 22 Feb 2017 21:06:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Feb 2017 21:06:52 +0000 Received: by simark.ca (Postfix, from userid 33) id 031A61E7DE; Wed, 22 Feb 2017 16:06:51 -0500 (EST) To: Eli Zaretskii Subject: Re: [PATCH] Fix usage of inferior_ptid in two thread_alive implementations X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 22 Feb 2017 21:06:00 -0000 From: Simon Marchi Cc: Pedro Alves , simon.marchi@ericsson.com, gdb-patches@sourceware.org In-Reply-To: <83o9yb3xdx.fsf@gnu.org> References: <20170207212450.2232-1-simon.marchi@ericsson.com> <0322ea0c-ce96-8b7c-5d2d-0efa87ab71ed@redhat.com> <8688edde-759a-7f84-482d-9823a8f546b3@redhat.com> <83o9yb3xdx.fsf@gnu.org> Message-ID: <3050e2df7823690bc1b6d77920ec1303@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.3 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00608.txt.bz2 On 2017-02-09 15:46, Eli Zaretskii wrote: >> Cc: Simon Marchi , >> gdb-patches@sourceware.org >> From: Pedro Alves >> Date: Thu, 9 Feb 2017 17:53:16 +0000 >> >> On 02/09/2017 04:46 PM, Simon Marchi wrote: >> > On 2017-02-08 07:40, Pedro Alves wrote: >> >> On 02/07/2017 09:24 PM, Simon Marchi wrote: >> >>> While inspecting some target code, I noticed that in these two >> >>> implementations of thread_alive, inferior_ptid is referenced directly >> >>> instead of using the ptid passed as parameters. I guess that it is >> >>> wrong, although I can't really test it in both cases. >> >> >> >> I can't test either, but it looks right to me. >> > >> > Soooo.. is this an approval :) ? >> >> OK by the end of the week to give a chance of area >> maintainers or interested folks to comment. E.g., Eli >> is the go32-nat.c maintainer and I don't mean to overstep, >> though that bit does look obvious to me. > > Is that function even called in the go32 port? Why wouldn't it? For example, you could have this pseudo-stack: #0 go32_thread_alive #1 target_thread_alive #2 thread_alive #3 thread_apply_all_command If this target doesn't support multiple threads, it's possible that inferior_ptid will always be equal to ptid (equal to the only existing thread). But still it would be "more correct" to read the parameter instead of the global, IMO. Simon