From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C6CB3858408; Sun, 21 Jan 2024 16:25:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C6CB3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705854339; bh=pPq7/hzNvChfvDdh5WLh0SSga2DwsJ1X97ePuHXAACo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DFkO+YQtzjBADSA/Bm6sSLIZJaSWYlNiClkSgFI9GvvGCvCxPLtJ4SUl/LG4nMubD +0kqe+N0WQsW9gwVFyHdx/jnaKmogWnp7grjdURq/MqoG2uWKisYW+Exbh4eQZh868 ynhPY0NEM/WD+99WkAsWbVPjCQVYjAmohVqYg860= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug record/29178] GDB wont print frame when reverse stepping out of recursive function Date: Sun, 21 Jan 2024 16:25:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: record X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29178 --- Comment #3 from Sourceware Commits --- The master branch has been updated by Lancelot SIX : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5266f5c25b20= ed6411b263952f52032afafd280d commit 5266f5c25b20ed6411b263952f52032afafd280d Author: Lancelot SIX Date: Thu Dec 28 11:51:31 2023 +0000 gdb/infrun: lazily load curr_frame_id in process_event_stop_test A recent(ish) change in gdb/infrun.c made process_event_stop_test load debug information where it would not have done so previously. The change is: commit bf2813aff8f2988ad3d53e819a0415abf295c91f AuthorDate: Fri Sep 1 13:47:32 2023 +0200 CommitDate: Mon Nov 20 10:54:03 2023 +0100 gdb/record: print frame information when exiting a recursive ca= ll Currently, when GDB is reverse stepping out of a function into= the same function due to a recursive call, it doesn't print frame information, as reported by PR record/29178. This happens because when the infe= rior leaves the current frame, GDB decides to refresh the step information, clobbering the original step_frame_id, making it impossible to figure out later on that the frame has been changed. This commit changes GDB so that, if we notice we're in this exa= ct situation, we won't refresh the step information. Because of implementation details, this change can cause some d= ebug information to be read when it normally wouldn't before, which showed up as a regression on gdb.dwarf2/dw2-out-of-range-end-of-seq. Since that isn't a problem, the test was changed to allow for the new outp= ut. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29178 Although there is nothing wrong with this change in principle, it happens to break most of the tests in gdb/testsuite/gdb.rocm/*.exp. This is because those tests do rely on GDB not loading debug information. This is necessary because the debug information produced for AMDGPU code is using DWARF extensions which are not supported by GDB at this point. In this patch, I propose to use a lazy loading mechanism so the frame_id for the current frame is only computed when required instead of when entering process_event_stop_test. The lazy_loader class is currently defined locally in infrun.c, but if it turns out to be useful elsewhere, it could go somewhere under gdbsupport. This patch should restore the behavior GDB had before bf2813aff8f2988ad3d53e819a0415abf295c91f when it comes to load debug info. Another approach could have been to revert fb84fbf8a51f5be2e78765508ebd9753af96b492 (gdb/infrun: simplify process_event_stop_test) and adjust the implementation of bf2813aff8f2988ad3d53e819a0415abf295c91f (gdb/record: print frame information when exiting a recursive call). However, I think that the lazy loading works well with the simplification done recently, so I went down that route. Regression tested on x86_64-linux (Ubuntu 22.04) with AMDGPU support. Change-Id: Ib63a162128130d1786a77c98623e9e3dcbc363b7 Approved-by: Kevin Buettner --=20 You are receiving this mail because: You are on the CC list for the bug.=