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 D7B093858C56 for ; Thu, 21 Dec 2023 20:28:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7B093858C56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D7B093858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703190534; cv=none; b=F/i8+4hXNpX6j/d5loL1e9zhhvArF9WPxoeye7wB0cToBx1O2oOSg+LJ1QPESr98MjY40uIg+oWcHcExsfqEJg7fup8ImZZ9xry5jUHu6mO7NwRp4LaF/5DdYqxQ1YurZ1QufZ2Cori7KEH8g3fXdFr4hQ5UBSUo8SMAVvqj+TE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703190534; c=relaxed/simple; bh=tnWR4SAenchvBluhSng7QnDDdZaYarAXBYko5HxwAHg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=J7NM47qtCIQsnNnvq3K4pcQTdpzXpiC65Y9DKLwYcG7t0Zpk3nutX12UiqoCoQ0LzShE1+aXAFN5pfi9P4KjEQbH5kWn0j3fTjh+xfBXsWPfZ18kWEVfGb664/hZKcgpxGmjXZf0KZO4iyqsQIM00lUOrej2fZJV55aYR+B4yuU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1703190533; bh=tnWR4SAenchvBluhSng7QnDDdZaYarAXBYko5HxwAHg=; h=Date:Subject:To:References:From:In-Reply-To:From; b=qrsDlidCLHgruno+t+7S95D04AAgiFHdSuTmOJzrj6pr0KtL06EocjiiQlAAdOJf1 rpl7nWHvUDNhanp4qQ3eFLzfoN7nkFs1c3xCDish7Hceu2CK6kHz8smjnJK9UFLlle kRXMKAQWjrq09+Ca56GZ25X2+qoUpTUhyy4jIAkY= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 718B01E0AC; Thu, 21 Dec 2023 15:28:53 -0500 (EST) Message-ID: <49f33757-fab9-4b73-bdd7-5d2cc44dad83@simark.ca> Date: Thu, 21 Dec 2023 15:28:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/26] gdbserver: add a pointer to the owner thread in regcache Content-Language: fr To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: <5e9fc384d9456c05d12037a4f2f1999b675c19f5.1677582744.git.tankut.baris.aktemur@intel.com> From: Simon Marchi In-Reply-To: <5e9fc384d9456c05d12037a4f2f1999b675c19f5.1677582744.git.tankut.baris.aktemur@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/28/23 06:28, Tankut Baris Aktemur via Gdb-patches wrote: > Add a back-link in regcache to the thread that owns the regcache. > This will help us in future patches to refer to the right thread > object without having to rely on the global current_thread pointer. I'm a bit hesitant with this change as-is, because it sets the thread field only in some instances of regcache. There are code paths that create regcaches but don't set it. It adds a bit of cognitive load to have to think about when it is set and when it isn't. I'll have to see how it's used in the rest of the series. Perhaps that doesn't work, but intuitively I'm thinking that it might be better to get the thread from the context in another way, like passing it down to functions as an argument. Simon