From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ieZJKQl3fGqsliAAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 09:37:13 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KppAe6gx; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A5DAE1E033; Wed, 12 Aug 2026 09:37:13 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 250811E033 for ; Wed, 12 Aug 2026 09:37:13 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2ADB64BA79A0 for ; Wed, 12 Aug 2026 13:37:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2ADB64BA79A0 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KppAe6gx Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by sourceware.org (Postfix) with ESMTPS id 1613C4BB3B97 for ; Wed, 12 Aug 2026 13:29:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1613C4BB3B97 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1613C4BB3B97 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541389; cv=none; b=cqvJ4UrQM9uu3qWVpHgb4KcTqtCYQQe5ZXZkzzuLhU9ksAWylr5SI6m+JAOCkAT7nPUbSYiwK3AW3qucc1/OM3DKUKaX0Po5PcjO4b8s5NXylWzxwXDQ7yvA/d5NjLdWGfHeQF/KpScWhUlq7JCR2n0zKpyOuFptBmDgPAP01WU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541389; c=relaxed/simple; bh=f9yivHtwbJAkiHSLepweBkEC03ogfiCORc4IVyAHtPc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GadSUD4LeWdeq6M6sN5dTdeR2YWIib8W1EumbGJ2yd7K9ui8h8M6DM/xR7t5T4flegDyPocdpztjAzS1wHI62pRwmem6fgGFk/Nqms3Ki86xO+X4AdUC15wwTDA5DX5xTTLwpoZpkHAIejNUiMzPDZVcjmjBej37prVj9E7QsPs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KppAe6gx DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1613C4BB3B97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786541389; x=1818077389; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f9yivHtwbJAkiHSLepweBkEC03ogfiCORc4IVyAHtPc=; b=KppAe6gxvapZrS3AZ1KMlTQlI542p9Y9tyd4xT2WFaKX7N4sswY8At35 8i6oOY+o8Rc5OqtOUBgIpnCTkXi+On1crHWOfhgYJbn6rzmVRIRHOgvH6 tFkLNA+3eRZrd8Jb8QWJyKrc+GmpEZi7O44bZphEKUvMHS4tkh+O+jSzl rGETlSSQMFEF5GHG6tKZcxaZ0FQ9L1rHnB/ZT5X4UUbJB+sn00oEzNllV byJ2CuTsdDn1v/T93PBRjkE9OISRh3ChKb4z7ctBwslYzwr+cLHmc3lIh yyaxMyo62jMSK9hVnb+kQmGDaSqyae7lUMLxRvMlh6Ynkceen3QP0xNJJ Q==; X-CSE-ConnectionGUID: wO4S20x7T4iVWVfFN3R0Vw== X-CSE-MsgGUID: f0/0dEZIQbqeahikHZK6Yw== X-IronPort-AV: E=McAfee;i="6800,10657,11872"; a="97757920" X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="97757920" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:29:48 -0700 X-CSE-ConnectionGUID: EWg6cxVhRNGLoLDFBFHcyA== X-CSE-MsgGUID: lNSGVAVJRU2VQsaxwn3EeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="259818005" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:29:47 -0700 From: Markus Metzger To: gdb-patches@sourceware.org Cc: Tankut Baris Aktemur Subject: [PATCH v4 32/44] gdbserver: add a pointer to the owner thread in regcache Date: Wed, 12 Aug 2026 15:27:52 +0200 Message-ID: <20260812132805.380163-33-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260812132805.380163-1-markus.t.metzger@intel.com> References: <20260812132805.380163-1-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Tankut Baris Aktemur 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. --- gdbserver/regcache.cc | 1 + gdbserver/regcache.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc index 7e1fd9a82e0..1084e61d62a 100644 --- a/gdbserver/regcache.cc +++ b/gdbserver/regcache.cc @@ -44,6 +44,7 @@ get_thread_regcache (thread_info *thread, bool fetch) thread->set_regcache (std::make_unique (proc->tdesc)); regcache = thread->regcache (); + regcache->thread = thread; } if (fetch && !regcache->registers_fetched) diff --git a/gdbserver/regcache.h b/gdbserver/regcache.h index 2f0fac6e7d0..abe19f9ec41 100644 --- a/gdbserver/regcache.h +++ b/gdbserver/regcache.h @@ -34,6 +34,9 @@ struct regcache : public reg_buffer_common /* The regcache's target description. */ const struct target_desc *tdesc = nullptr; + /* Back-link to the thread to which this regcache belongs. */ + thread_info *thread = nullptr; + /* Whether the REGISTERS buffer's contents are fetched. If false, we haven't fetched the registers from the target yet. Note that this register cache is _not_ pass-through, unlike GDB's. Also, -- 2.43.0 ________________________________________ Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 (89) 99143-0 www.intel.de Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.