From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D15CB385E003 for ; Wed, 25 Mar 2020 21:08:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D15CB385E003 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AE2AF1E5F8; Wed, 25 Mar 2020 17:08:44 -0400 (EDT) Subject: Re: [PATCH] Implement nbsd_nat_target::thread_alive To: Kamil Rytarowski , John Baldwin , gdb-patches@sourceware.org References: <20200325193646.29248-1-n54@gmx.com> <64888cf7-8aff-20df-db9e-72b911eebc99@FreeBSD.org> <3349e5b4-d936-4597-7afe-4cef27216c93@gmx.com> From: Simon Marchi Message-ID: Date: Wed, 25 Mar 2020 17:08:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <3349e5b4-d936-4597-7afe-4cef27216c93@gmx.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2020 21:08:46 -0000 On 2020-03-25 5:01 p.m., Kamil Rytarowski wrote: > On 25.03.2020 21:42, John Baldwin wrote: >> Given that you have nearly identical code both here and in the thread_name >> method in your other patch, perhaps it makes sense to have a single >> "gdb::unique_xmalloc_ptr fetch_kinfo_lwp(ptid_t ptid)" >> helper function that the other routines could share? Perhaps instead of >> just returning the pointer to the array of structures it could take a lamda >> function that is invoked on the matching 'kl' instance with the correct lwp? >> > > I can do it. I will submit these two patches in one go. I will also add > a third similar function to list threads within a process. > > Normally, I would go for PT_LWPSTATUS, but it is available since NetBSD >> 10 and for the time being sysctl(3) is more portable. And let me mention the same thing I've told John :). Please add a meaningful commit message, explaining why you do this change. It's easy to see _what_ it does, but not _why_ you needed to do it. Does it enable some feature, does it fix some test case, something else? What impact does it have? Simon