From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xHgYKJMhCmZwZh4AWB0awg (envelope-from ) for ; Sun, 31 Mar 2024 22:53:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1711939987; bh=70a0UtC3V1RM1QOhTR1NW0mX1TvrOuKoGVd/7RpjC/o=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=v1rciMi9OJypMO1PQTudW/CPTlw5n3aIxiJZ0Y8aNzN9QmqYo0Kn/bYXjbjkgN0bf YJTepq5V5zDBP/SJUcwbVDiWzgpZGkc1vTZDXUOUip1/lPbiQ1Rk7YzzOVh74oVxxv jMmCPeI3ixnFywL5tb2yyT8TffI1pF1wxZOteUC8= Received: by simark.ca (Postfix, from userid 112) id 919781E0C0; Sun, 31 Mar 2024 22:53:07 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=Pu4bkLKZ; dkim-atps=neutral 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 679FB1E08C for ; Sun, 31 Mar 2024 22:53:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D8A0385841B for ; Mon, 1 Apr 2024 02:53:05 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 6C6743858CDA for ; Mon, 1 Apr 2024 02:52:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C6743858CDA 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 6C6743858CDA 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=1711939968; cv=none; b=l6bfuRC/L7YJr02Hcu0lsWQ8FLUeyZbqgCCSA7HVBNYE/yRB2Q9UBbLKohIr7gfGLaKvE6tJ20IbXYwNreiBZvuQW2kLN8QEKG+v/FqUMxaJRabzJS2IwL+NUpHywGP072Z4lMhQiOeGfD2c7IUqbzBfHdxQfeoBScCqKEp5xfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711939968; c=relaxed/simple; bh=70a0UtC3V1RM1QOhTR1NW0mX1TvrOuKoGVd/7RpjC/o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ZJfHSKo7aKd4Xv1HmVAKdeR0HeizlbNjZCZeLzA6ZAjdlCGJGOlLo2kMjNIHdXMaCWz7I8UJdTQxdlEjuhVppIyRdWVlERlD/sbCfcwT7WUV0XJqWTIE5S/eP7E+xFF2N2pEG5//fha+bNM7vJc+5qJ8vYXjFsGBSd6ouZnbElk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1711939962; bh=70a0UtC3V1RM1QOhTR1NW0mX1TvrOuKoGVd/7RpjC/o=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Pu4bkLKZmVGdlI6DlKktbe3mALXlZ3Nl/0vr2Vf4vWBv/i9WRZSG2Ejbvn4abWvwm +A42kMiDZI2vlu/conr/kzSS8KWktzUnm16RNAwd6AbiBblkjEMzfmRa1JMyszZR3j tQIMbUF2O/0xqeO1hlj069QM7U+Rf9mdGpEODWf4= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 5DB921E08C; Sun, 31 Mar 2024 22:52:42 -0400 (EDT) Message-ID: <66c53f57-006a-4a2f-bce7-bb04d7b58566@simark.ca> Date: Sun, 31 Mar 2024 22:52:42 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Remove unnecessary get_current_frame calls from infrun.c To: Bernd Edlinger , gdb-patches@sourceware.org References: Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, 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 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 On 2024-03-31 06:50, Bernd Edlinger wrote: > Since the frame variable is now a frame_info_ptr, the issue > with the dangling frame pointer is apparently no longer there. > > So remove the re-fetch code and the corresponding meanwhile > misleading comments. > --- > gdb/infrun.c | 24 ++++-------------------- > 1 file changed, 4 insertions(+), 20 deletions(-) > > diff --git a/gdb/infrun.c b/gdb/infrun.c > index a5030b16376..521c3b0299c 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -7056,11 +7056,6 @@ handle_signal_stop (struct execution_control_state *ecs) > ecs->event_thread->stop_pc (), > ecs->ws); > skip_inline_frames (ecs->event_thread, stop_chain); > - > - /* Re-fetch current thread's frame in case that invalidated > - the frame cache. */ > - frame = get_current_frame (); > - gdbarch = get_frame_arch (frame); For `frame` I agree, I think we can remove it. But I'm wondering about `gdbarch`. Before we had `frame_info_ptr`, even if `frame` got invalidated, it didn't seem necessary to reset `gdbarch`. Are there cases where you would get a different value for `gdbarch` as it currently holds? I can't think of any. I'm leaning towards saying that this is fine. This is the patch that introduced it, if you want more context: https://inbox.sourceware.org/gdb-patches/alpine.DEB.1.10.1206121703180.23962@tp.orcam.me.uk/#t Simon