From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oVbpD7o/CWaOfx0AWB0awg (envelope-from ) for ; Sun, 31 Mar 2024 06:49:30 -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=TKxf7kzd; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 356771E0C0; Sun, 31 Mar 2024 06:49:30 -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 C30C01E030 for ; Sun, 31 Mar 2024 06:49:27 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 39C81385842D for ; Sun, 31 Mar 2024 10:49:27 +0000 (GMT) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2101.outbound.protection.outlook.com [40.92.91.101]) by sourceware.org (Postfix) with ESMTPS id B4CAF3858D1E for ; Sun, 31 Mar 2024 10:49:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B4CAF3858D1E 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 B4CAF3858D1E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.92.91.101 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711882147; cv=pass; b=ZSb1j5SdYsts14meSwvb6FnQLFXurc6tSc2XbD8uEL5fDVJYvSOZyoKGi0napPQcU6gMee7Kq4eSUIAgCuuHAtjXXT0aw0WowC2j0mAmpz/wLASL+s00TW6qwBRAmu1vgbV6qXdKLEaqTM9Y5w/OsNy8xP4jjqfI+ifRLiwDqeQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711882147; c=relaxed/simple; bh=npWy0xXc/zA6cVcPKaRW6puh4c3MXmxKFNMdb7A01xs=; h=DKIM-Signature:Message-ID:Date:To:From:Subject:MIME-Version; b=dVLTZf3alrAfO6zSsgzfHmkbDMF2UVMpqmbRRgzj27HbK/kSiEH7FswpyCC+fKbj8XYIZFShdXM2KfUOw6tGg1XPgteltsYIncfHGxRcigxyu5L8CXhD42G4zNIhU8F6VgEkYG9+Spi5qtPXABjuiDobdgjhP/Bur5s2p9f80jE= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SW9fky5hIDKmajx451oggUa9d7HwmP3nEBTtrMtnpt7xSDw8zREyEFbk6p2dYafeIYkMzFDNiG1kUSIqWSNpQgsVGYo3TofsfcuSHwyiYnJvyAJHv9wpIAYFg69+Oz5oBCIUM6rmzpzyefgTVX4sDxnLdaGiHDOfsV0sBGOFxSK/XEGf3G9hSMBlwIuoMXCdi4M1XEwvknmg7RvCX/k6A9NqwK1YYlC723sgGjloLc59Zpsl/3Nu3pnrpyWun1rOp3y/nfTQMhD8zZbrdrRY+X1Z21Av8R1Jkq9tXXfrgGDf4gjwqdwzM6NeZU9cO2HXLuBlLT0aJXXR15JRmT+lQg== 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=NrZkNF15uk3cvUcKFTIsQW0rxXHgazkQdM3Qgz/VW8g=; b=RZMRchvddmoqzd3MO+VrbSPhNJskBzf+bEEJnCwUA9/9h7fMhqQRYVBy25cwz/NPQje4pi/udiGyAA8gtD28PiLH8Io0nZ+VSwV+6vSeMbcl7Hczt2K6ZrDLLCVrm88FDl5/EmNJcA1LUH9yL4YPe3lsf4vFFwD6NIMDWz7WgeYJcZAViRIXugl9HN2wTkpLusw5K3jCdFaoJ42bleMf1gFb6xfUapKqzOvJxfiB9zMAgeBPNRuMgIf5LrzeWcxtxc12ajoEceQifRuSsveDd9hlbyJ5xYVluhrfzu0t8MAlXuLrglCf0Aw4RUICitb2peoufN3H7mr+b5a5Pdz87w== 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=NrZkNF15uk3cvUcKFTIsQW0rxXHgazkQdM3Qgz/VW8g=; b=TKxf7kzdPHJY2OmaZyyffJZo/MrK1Zsap6moIe2nNKY1ZVQAYwgAhRMvJGJfm75+fSfHLDGTGuC/vb+mdik83F80D9yzOE+AmKnIJQbdIAoGAVWLvCx9Zh7UyatEx6GbYz6A1yHeWq6ps0KyCBk2zcQaaOopw1uJcOlv5QY+wGwqEPT9gy5NMPWDd60yLaezPPWVKVboZAHmHDQaSpkgO4iN/OXDPsx2lx9dQ6/Jm+hbOnRrboGzKnD01HS80UcCE1cw8FMOQemtOJqIb/vCiozmu1XY9PxkgOVWvIUSxCpnDdPNFy8W6X8OxQe63KlEoH7Gyt5GZ5M704/jTflmSA== Received: from AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) by PR3P193MB0912.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:97::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.43; Sun, 31 Mar 2024 10:49:02 +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; Sun, 31 Mar 2024 10:49:02 +0000 Message-ID: Date: Sun, 31 Mar 2024 12:50:45 +0200 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gdb-patches@sourceware.org From: Bernd Edlinger Subject: [PATCH] Remove unnecessary get_current_frame calls from infrun.c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TMN: [nBm18fVfSElyk3W4Ew3YDhT7Uh2/178NPadD3tnPQbcq1JCIQxGndHUARkaqvydR] X-ClientProxiedBy: FR5P281CA0058.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f0::14) To AS8P193MB1285.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:333::21) X-Microsoft-Original-Message-ID: <5f57e5a4-98f4-467e-ac0e-62277ac49ec8@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P193MB1285:EE_|PR3P193MB0912:EE_ X-MS-Office365-Filtering-Correlation-Id: da1584a1-695a-43ea-43ae-08dc51702d58 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gcCVPCRz/1W04fz72ZrzwTK5r8nqtJKrscQINgPHNpvomTDeR2sHm5q+BUyQNYjfW+irH83wWFiO3tCxAZ1xhnQ6a21eMI2Up5F1G6X+K/MyS3ungbdaxd94Ay/OwvN3+lhf0wx4Pfsh9llpJaB9oe5vqtWnrpfNbfOhOmWa3myUM5/RflOfuumnUT0CUg/lS0VHMQAzHITpObvbbYxKJYoLwfMObW2sZgAbmxdZ3jHHGWdv2o6ZzMqKUjTHnnm03jdt/8TwE813JFrS2gMb/Rxcne6IbSowpbaMgaEXDvqMpcyQoqf1x+RiRoLE8I6872QiGw6CDSwJ/Kh4rB5ydtZZ7QPVrWms9cBrl3bbNKRDLlbFB+2j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NeGlv?= =?utf-8?B?c1FYeVkzeTRLQmZFekJScTdEWlZ4bjViZlVHNjc1M2pTZllnRzVqcXhYRTdW?= =?utf-8?B?R0ozTXAwRkwvRVl2UHRQLzh3enhZaGVraHNCRldFZElHNXZGSk5SYUVmR2tP?= =?utf-8?B?YUhYREZVVGVWYVRTNGsyM2g4dEF0bmV3dFNYYVYzbU13UVBQdnFYUFlkTFo2?= =?utf-8?Q?lsLW6C+x4kllIrXfYFyjMVYIPgNj1+SkMbYPIkl?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-80ceb.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: da1584a1-695a-43ea-43ae-08dc51702d58 X-MS-Exchange-CrossTenant-AuthSource: AS8P193MB1285.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2024 10:49:02.0374 (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: PR3P193MB0912 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS 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 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); } } @@ -7419,12 +7414,6 @@ process_event_stop_test (struct execution_control_state *ecs) bp_jit_event). Run them now. */ bpstat_run_callbacks (ecs->event_thread->control.stop_bpstat); - /* If we hit an internal event that triggers symbol changes, the - current frame will be invalidated within bpstat_what (e.g., if we - hit an internal solib event). Re-fetch it. */ - frame = get_current_frame (); - gdbarch = get_frame_arch (frame); - /* Shorthand to make if statements smaller. */ struct frame_id original_frame_id = ecs->event_thread->control.step_frame_id; @@ -7670,11 +7659,6 @@ process_event_stop_test (struct execution_control_state *ecs) return; } - /* Re-fetch current thread's frame in case the code above caused - the frame cache to be re-initialized, making our FRAME variable - a dangling pointer. */ - frame = get_current_frame (); - gdbarch = get_frame_arch (frame); fill_in_stop_func (gdbarch, ecs); /* If stepping through a line, keep going if still within it. @@ -7855,7 +7839,7 @@ process_event_stop_test (struct execution_control_state *ecs) if ((get_stack_frame_id (frame) != ecs->event_thread->control.step_stack_frame_id) && get_frame_type (frame) != SIGTRAMP_FRAME - && ((frame_unwind_caller_id (get_current_frame ()) + && ((frame_unwind_caller_id (frame) == ecs->event_thread->control.step_stack_frame_id) && ((ecs->event_thread->control.step_stack_frame_id != outer_frame_id) @@ -8138,7 +8122,7 @@ process_event_stop_test (struct execution_control_state *ecs) { infrun_debug_printf ("stepped into inlined function"); - symtab_and_line call_sal = find_frame_sal (get_current_frame ()); + symtab_and_line call_sal = find_frame_sal (frame); if (ecs->event_thread->control.step_over_calls != STEP_OVER_ALL) { @@ -8180,9 +8164,9 @@ process_event_stop_test (struct execution_control_state *ecs) to go further up to find the exact frame ID, we are stepping through a more inlined call beyond its call site. */ - if (get_frame_type (get_current_frame ()) == INLINE_FRAME + if (get_frame_type (frame) == INLINE_FRAME && (*curr_frame_id != original_frame_id) - && stepped_in_from (get_current_frame (), original_frame_id)) + && stepped_in_from (frame, original_frame_id)) { infrun_debug_printf ("stepping through inlined function"); -- 2.39.2