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 397703858C78 for ; Fri, 29 Sep 2023 18:25:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 397703858C78 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com Received: from localhost.localdomain (unknown [207.253.217.242]) (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 ESMTPSA id 094761E110; Fri, 29 Sep 2023 14:25:45 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 5/5] gdb: scope down registers_changed call in inferior::set_arch Date: Fri, 29 Sep 2023 14:24:39 -0400 Message-ID: <20230929182541.138320-6-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230929182541.138320-1-simon.marchi@efficios.com> References: <20230929182541.138320-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1173.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP 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: inferior::set_arch calls registers_changed, which invalidates all regcaches. It would be enough to invalidate only regcaches of threads belonging to this inferior. Call registers_changed_ptid instead, with the proper process target / ptid. If the inferior does not have a process target, there should be no regcaches for that inferior, so no need to invalidate anything. Change-Id: Id8b5500acb7f373b01a534f16d3a7d028dc0d882 --- gdb/inferior.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/inferior.c b/gdb/inferior.c index 21795a0d8a42..efe57cceae3e 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -180,7 +180,10 @@ inferior::set_arch (gdbarch *arch) gdb_assert (gdbarch_initialized_p (arch)); m_gdbarch = arch; gdb::observers::architecture_changed.notify (this, arch); - registers_changed (); + + process_stratum_target *proc_target = this->process_target (); + if (proc_target != nullptr) + registers_changed_ptid (proc_target, ptid_t (this->pid)); } void -- 2.42.0