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 5FF5E3861882 for ; Thu, 21 Dec 2023 20:22:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5FF5E3861882 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 5FF5E3861882 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=1703190133; cv=none; b=PtFNI6dH6WQ5exep9DqNFRyTKWoxR1OfNdXkVKiv8BhuY1W1VvuZaSfq8eZKvJ6DOhiJ4Dh8sT120v7CaEXLOFOz8n9HjRF4Lsqlr3dkM3Yzl8EM6IEgFJjyKmlCiyVRqb6GylhcReE0fxCcyMYXm8JsNmtR5R5Vmt3Qi3ZZC8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703190133; c=relaxed/simple; bh=QMSc+0asabpI14/hpw79jjYM+LMBrV5vXMboP1lqGOQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=BGieKhN//dAXfu5Peg7VygTlz8h/Rzuo0OJY0mY8uBoeSwuvBEbiQWP8hujt5IkHmpb+52gpZMI+hwY7Ds9sgfdOPj3XRm8cjwxzPTAE8L3Ef+05WCUBGCvo+Bwb6WwV//cgBWOiE3pp009w01tgXHic5xdL0wZXdKQrwqvUjSw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1703190131; bh=QMSc+0asabpI14/hpw79jjYM+LMBrV5vXMboP1lqGOQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=r8K4kowBzFgWU+/0gxcZsyYItZhmmP/89UgoiVdaw7C0ZRYVhFeCNO8f4FT04DMOD p+gZhlQV7XZiyhxXACzET+KkgFshtkM6S1F/X1rOwCM4XmQToFg7awJq9gDIp7BnE1 OkHv0jph3ijS/Yi5P9qDYa29lUezcA1vYcIvXNxs= 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 B6D621E0AC; Thu, 21 Dec 2023 15:22:11 -0500 (EST) Message-ID: <0dd7356f-bc1c-4e18-bad8-5ecc25b753ed@simark.ca> Date: Thu, 21 Dec 2023 15:22:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/26] gdbserver: by-pass regcache to access tdesc only Content-Language: fr To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: From: Simon Marchi In-Reply-To: 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: > The `get_thread_regcache` function has a `fetch` option to skip > fetching the registers from the target. It seems this option is set > to false only at uses where we just need to access the tdesc through > the regcache of the current thread, as in > > struct regcache *regcache = get_thread_regcache (current_thread, 0); > ... regcache->tdesc ... > > Since the tdesc of a regcache is set from the process of the thread > that owns the regcache, we can simplify the code to access the tdesc > via the process, as in > > ... current_process ()->tdesc ... > > This is intended to be a refactoring with no behavioral change. > > Tested only for the linux-x86-low target. Thanks, that LGTM. You can apply it immediately, I think, it's good on its own. Approved-By: Simon Marchi Simon