From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8MngD9DbCmZFFB8AWB0awg (envelope-from ) for ; Mon, 01 Apr 2024 12:07:44 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=yARAfjIE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3C3341E0C0; Mon, 1 Apr 2024 12:07:44 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 2B0541E030 for ; Mon, 1 Apr 2024 12:07:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CCBC73858D34 for ; Mon, 1 Apr 2024 16:07:41 +0000 (GMT) Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 7723D3858D28 for ; Mon, 1 Apr 2024 16:07:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7723D3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7723D3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711987640; cv=none; b=fSk4nphep3EOwbD+tWEzlEVrkPJBynAgQCK/NHFLG8eZKIc1hK4qlwSKeSefPHR/P2ZXH1+Q+uSmT0MigXizoIZwEc+ILujXJ8MPp2MBBvyKgJ4SN69RtAyA3zOhnPcu2nBPi7D+UZvIPY6hSyUHxxBUQvVW4mdCMvLB6MLBtEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711987640; c=relaxed/simple; bh=f3mILAcoK2A2TRVlVqtqf5uug7uMtT0Vvw3vkGJRF5Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RVwtV1+b8ZbZ+4jQ7+vvvnHnKhi5te7iJHeW/fx+CmoqPSOglpoHdaK/T7lZb+q18lyGTmWvoRta6XQPkRna3tyL0WGkDgOHq5+jQH62Oo0C66XHE2rK3xVxhblNjOWbQbC3Co9i3qWP+jmhK7KhitDE2UOWi+CI7vWQjSdPlbk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id rJvUrR3LxQr4SrKBnrORga; Mon, 01 Apr 2024 16:07:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id rKBnrUE1aEKylrKBnrCO9c; Mon, 01 Apr 2024 16:07:15 +0000 X-Authority-Analysis: v=2.4 cv=Bombw5X5 c=1 sm=1 tr=0 ts=660adbb3 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=raytVjVEu-sA:10 a=Qbun_eYptAEA:10 a=dzWzf_mpAAAA:8 a=h9SxbJMVOv-Wln-g6ZUA:9 a=b4DR9a7p2ZdsqdHBznES:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=G3bHBrZb3r/GdDmg8obidgyz+cnkklg67y9KJyGrSBs=; b=yARAfjIEEe1ULyQ+hGQL9bBxfq VFWkERHxLjUTIUGhNBgvx9d2g5kjDpa9G+ap/k4Y1gealmL0elFMxuQX58giCGmOQAwvVGXPTSW3T tFsu6S4SoUXPw9LAjhE6BsUzz; Received: from 97-122-82-115.hlrn.qwest.net ([97.122.82.115]:35556 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rrKBm-001TmT-31; Mon, 01 Apr 2024 10:07:14 -0600 From: Tom Tromey To: Simon Marchi Cc: Bernd Edlinger , gdb-patches@sourceware.org Subject: Re: [PATCH] Remove unnecessary get_current_frame calls from infrun.c References: <66c53f57-006a-4a2f-bce7-bb04d7b58566@simark.ca> X-Attribution: Tom Date: Mon, 01 Apr 2024 10:07:14 -0600 In-Reply-To: <66c53f57-006a-4a2f-bce7-bb04d7b58566@simark.ca> (Simon Marchi's message of "Sun, 31 Mar 2024 22:52:42 -0400") Message-ID: <8734s5awy5.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.82.115 X-Source-L: No X-Exim-ID: 1rrKBm-001TmT-31 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-82-115.hlrn.qwest.net (murgatroyd) [97.122.82.115]:35556 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOGGMH+sqqbq7oOqKGC5iop6MwqGL+uh2NO0rQ1xUI4eiz3/AI/5TdvBpQUDtTRQCDROC9Vr6x9xaQbkq9sdGIVEhGIceNRPkFsDVx0lReJViyYCCBYy hdSeQfyQsypp1JjfVAK8KP7oMhdQs8g9xj8cFO9k0nf6OZIHCx8z7xXkIV+qJit56/2SSbXTOTDrTCnYhSYKZgzjcUTPoePyXOs= X-Spam-Status: No, score=-3015.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 >>>>> "Simon" == Simon Marchi writes: >> - /* Re-fetch current thread's frame in case that invalidated >> - the frame cache. */ >> - frame = get_current_frame (); >> - gdbarch = get_frame_arch (frame); Simon> For `frame` I agree, I think we can remove it. But I'm wondering about Simon> `gdbarch`. Before we had `frame_info_ptr`, even if `frame` got Simon> invalidated, it didn't seem necessary to reset `gdbarch`. Are there Simon> cases where you would get a different value for `gdbarch` as it Simon> currently holds? I can't think of any. I'm leaning towards saying that Simon> this is fine. I think the main danger in this patch is if the current comments are wrong -- that is, when it is referring to something reinitializing the frame cache, is that correct? Or could the inferior be restarted somewhere in here, resulting in a different current frame? In the latter case get_current_frame definitely has to be called again, the old frame may not even exist. I don't think it's possible for the gdbarch to change mid-frame, only between frames. This capability has been desired a few times (x86 boot-up apparently switches modes or something), but patches have never been supplied. So, I tend to think not resetting gdbarch is fine. Tom