From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28741 invoked by alias); 15 Apr 2017 01:01:34 -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 28722 invoked by uid 89); 15 Apr 2017 01:01:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=postponed, mua, stock, MUA X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Apr 2017 01:01:31 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1czC5i-00031y-GW from Luis_Gustavo@mentor.com ; Fri, 14 Apr 2017 18:01:30 -0700 Received: from [172.30.15.52] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 14 Apr 2017 18:01:27 -0700 Reply-To: Luis Machado Subject: Re: [PATCH v2] PR threads/20743: Don't attempt to suspend or resume exited threads. References: <20170404173258.6512-1-jhb@FreeBSD.org> <62fcaaa0-35e3-2bed-fb5e-336a5c5ffbf4@codesourcery.com> <6029590.iEtzOUCDnR@ralph.baldwin.cx> To: John Baldwin , From: Luis Machado Message-ID: Date: Sat, 15 Apr 2017 01:01:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <6029590.iEtzOUCDnR@ralph.baldwin.cx> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00471.txt.bz2 On 04/14/2017 05:40 PM, John Baldwin wrote: > Hmm, the raw code looks fine. I know that my MUA (kmail) messes up formatting > of code as it displays tabs as 4 characters instead of 8? Here's the raw > code with tabs expanded to spaces: Ah, that could very well be it. > > ALL_NON_EXITED_THREADS (tp) > { > if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid)) > continue; > > if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid)) > request = PT_RESUME; > else > request = PT_SUSPEND; > > if (ptrace (request, ptid_get_lwp (tp->ptid), NULL, 0) == -1) > perror_with_name (("ptrace")); > } > The indentation here looks fine indeed. >> A question i have is why did we have to remove the original functions. >> Couldn't we have checked the non-exited-ness of the threads inside the >> callback? > > That was what the V1 patch did, but you and Pedro requested it use > ALL_NON_EXITED_THREADS instead, hence version 2. > Sorry, i swapped out the context of v1. >> Another bit... Since we're changing this code, might as well improve the >> perror message so it is more meaningful? > > I could perhaps do a followup to include the ptrace op in the various > perror's in this file (all of them use this, as do the various BSD > nat.c files used for register fetch/store). > That sounds like a good idea and could be postponed to a more convenient time. >> Otherwise i have no further comments. I assume you ran gdb's testsuite >> against this change and verified the results are sane? > > There were no regressions at least. With the stock tree there are > several unexpected failures already which I will get to at some point. > Great. I have no further comments.