From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mIuEBwLoCmbYHB8AWB0awg (envelope-from ) for ; Mon, 01 Apr 2024 12:59:46 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=HOTMAIL.DE header.i=@HOTMAIL.DE header.a=rsa-sha256 header.s=selector1 header.b=ZHWD7/wu; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1999F1E0C0; Mon, 1 Apr 2024 12:59:46 -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 070C61E030 for ; Mon, 1 Apr 2024 12:59:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E7703858D39 for ; Mon, 1 Apr 2024 16:59:43 +0000 (GMT) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2040.outbound.protection.outlook.com [40.92.50.40]) by sourceware.org (Postfix) with ESMTPS id 773053858D20 for ; Mon, 1 Apr 2024 16:59:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 773053858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 773053858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.92.50.40 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711990757; cv=pass; b=sgIPXOysRzci9MT81fNOPY+RtqkKUXb+15ZXSH4dzdJp1D6Bd3enFFukvkOe0EXfnZiI5x31VVH9lyuDJsFr5+jWX4ORXIlccr9twEQALdcc5Q0UljxBsdO70LONN4d+1DopOPnls9B+7awScn6BvfSdaCHv2mMvB36JzCYXCW0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711990757; c=relaxed/simple; bh=IicZ2KGKBjPuLjM3P3XW01e/ucE0nyKh2qPWEXXDh00=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=Cat3WRLUCGChOI+TxGwO5KzstnCxv/V8u2QvsHG4RK2wzy3QOBYyeHwZeg9aoJM4FAnX1nM3RQvVhrpu0UGGRWSgPuCW+Wc6/3MPTOat/Eya9T9BA9KaCvr0DRgU+VuEzPh02OEg711vxFY7oBDvtMfNn/L4EKHvefLFo4X4WsI= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mkA8qGX0AXZyVS6Th7hS2Kv8V+hcRa24Yt4FyCT7SB0CjMTr4Z1HoFfmgq+Ubv3o7owzGEMtKFTscTxCyfFh6wg9GuOuPOT8TEwFYrXDXUgVjuTu512vRUdeMXma44FkPBifMKgOoTLD2yNLG4bX2zGeHBQ2smiNqh2W8H5woL34IFsTw43KVIqbmGCuuEH87nfv2bXcgIcnrSrGyVN1Vkazc6kOmVCYfEM181pNJYMHsUA27Mb2y4bCrpD5fDA+G3xqoGGbu39GcXy98yqMw+R2iaB0Bf34lC4w489KabMtoIb65iK1/zfbjwWZYIhtVdWAhLDZvec51ZO8g6Yq8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IUHJkKeJGHPRWRA4YL/YjT6Jp+45HcILorbq5krP0gM=; b=bWb0MPAxJutlo0uwRuflVY+4wCMub2uxUIwdHXShxek9HicSc5se4qb3e0dk40BmUvc8z9i2gMJMePtlq2d95f4Rkv/l8GzkvQn5QEQWQGKin6zNTnZUQyC1P7lm1c7G7LdqOt1cUztNmLGWePNcH6s2p+ybNr/rNi0CCCzv2QRMQlgX+6uIXkRL7FWntDcC6XZvyENT5oQk/21kHlsuwj2Iy6eiwqbP8xhefFqHV8J62in4oSIyrYeiRK1nywDG+UQtHkLW/5qfEBnDew6FbSPhB0Dx4tByy0QxA7z3dX8apUuq9dqhh4GKzJXUsYydlFNMaB7emyPzscxBBst28Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HOTMAIL.DE; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IUHJkKeJGHPRWRA4YL/YjT6Jp+45HcILorbq5krP0gM=; b=ZHWD7/wuQ2RXWJf2atfmWoiJn9jRYoSuZAoBYFGGpWpXcKZihvLk7ynqpzxZiz9kk/JXkQ3NpKaaHqau17hV9texE+d9unR1gG5cGBT+CllKFp52B/xD8l6heBT30k65zc/XxsU1bXa5iqbZ4Wd43P8fUhUB/XW4hAbYwDZ79hr/WkLl+AcuNDZH2kbsKWHX39TLTGNr6PuW86j2OE5FcE4DHdi1Q9xfpsxkducV9hhXxqhnVxJAh/MP8RdUTmjppHDd1WxDpbHTZaXw6WvVTcVVOhBbJCAronWatV4UId/UiSJdeOKwqhzbEsQgrkfU7+oLLk9UNMJWm8uleIW54w== Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) by PR3P193MB0619.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:38::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 1 Apr 2024 16:59:12 +0000 Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM ([fe80::5403:f1ad:efaf:1f71]) by AS8P193MB1285.EURP193.PROD.OUTLOOK.COM ([fe80::5403:f1ad:efaf:1f71%4]) with mapi id 15.20.7409.042; Mon, 1 Apr 2024 16:59:12 +0000 Message-ID: Date: Mon, 1 Apr 2024 19:00:55 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Remove unnecessary get_current_frame calls from infrun.c To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <66c53f57-006a-4a2f-bce7-bb04d7b58566@simark.ca> <8734s5awy5.fsf@tromey.com> Content-Language: en-US From: Bernd Edlinger In-Reply-To: <8734s5awy5.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TMN: [9xpHl+qvcKvA6pJ3Pv+Cgl/0Eo0rlBNR5Dk+gr+0cEmBc39qsx9v/EyuJW5o3S+7] X-ClientProxiedBy: ZR0P278CA0126.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::23) To AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) X-Microsoft-Original-Message-ID: <7060ec97-5dfb-4171-b52e-8d224bd006f4@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P193MB1285:EE_|PR3P193MB0619:EE_ X-MS-Office365-Filtering-Correlation-Id: 6dfb660f-5e09-4289-57f2-08dc526d0dfd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R2TOn3PuyWAavhbAwfnCh5L/UYMXpppXuClJBBCC132VX71azq48uPAwzhN7RxSWwBDkZ/ksQgSXmsvC9Nv6BopFPoPxAAIVlig8I5E1TMv8AFw+/9issyFjg2xQP9cgxcYG9a9Kvy2x2jTtfsDo/oYkRbjhPmshQrKYyoYyLk3Wni/8z32pLlHKU4Ci3dY3MzWiDRVWeEmy9T7Z7EdSN1gpcSXWaQLSUhcdg+uJ3dYUKJHVwvyRv9+iS7TNycOQpX7Ps4DYKPfcL9Vppy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VWxJY0FMaUlNWDNHRjIzL00wT2gzaC81K0xJ?= =?utf-8?B?UVZUTkIvRzdrcFFjZCtwMHloaUIrYXhST2VFRUNneWorYVU2YTVjVEJXdEoy?= =?utf-8?B?VTIvT3AxZmJNek9HSU5PUGlHTk5qVmhMbkVYRENqRVVvbEZYbEFQcU9aYXlr?= =?utf-8?B?WnhkRWhSMXg1RVdsVFBGa3VQdy90VkswSnR5dVFBeDBsYjEzQkxJSXFleHli?= =?utf-8?B?RVJVSEJFUVRSY0JhaWpmemNQSlgxN05TZnVzdytPQXlkdDdDdzdmTGVmOU1t?= =?utf-8?Q?sWSwWGKkAAu683YerSQiT0aJNx5RkMqI0b8lzKq?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-80ceb.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 6dfb660f-5e09-4289-57f2-08dc526d0dfd X-MS-Exchange-CrossTenant-AuthSource: AS8P193MB1285.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 16:59:12.1537 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P193MB0619 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 4/1/24 18:07, Tom Tromey wrote: >>>>>> "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 am definitely sure that the comments refer to the previous side-effects of `skip_inline_frames` and `step_into_inline_frame` and probably others which may call `reinit_frame_cache`. But even before the invention of `frame_info_ptr` the `gdbarch *` was never really changing because of `reinit_frame_cache`. My experiments show at least that currently the gdbarch pointer will not become released while stepping, not even when re-loading the inferior the gdbarch pointer has ever changed for me. > 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. > Yep, is the patch approved then? Thanks, Bernd. > Tom