From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2F8203858D1E; Wed, 21 Dec 2022 16:56:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F8203858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671641766; bh=C8HVHUzKc5duSHH92okb4fjYj57NhI01x5TQTHqWnoA=; h=From:To:Subject:Date:From; b=GPd95aG6t4ZVwuZjcea0flHvmkHoDp7XwWlLj5pN/VlAC/Z4W4W8QDejgib7Mmmqx kWWd6Vac39gKBPMbv82ullaQ5cHZdLNhXdFB7NQDZcMNhKgBksn98NNosbSECpJWPC TvWhfHjvQYsPOK99fQV5CJwyHj6A5Yxu0RquFA/0= From: "cel at us dot ibm.com" To: gdb-prs@sourceware.org Subject: [Bug gdb/29927] New: reverse-finish requires two reverse next instructions to reach previous source line Date: Wed, 21 Dec 2022 16:56:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cel at us dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D29927 Bug ID: 29927 Summary: reverse-finish requires two reverse next instructions to reach previous source line Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: cel at us dot ibm.com Target Milestone: --- Currently on X86, when executing the finish command in reverse, gdb does a single step from the first instruction in the callee to get back to the caller. GDB stops on the last instruction in the source code line where the call was made. When stopped at the last instruction of the source code line, a reverse next or step command will stop at the first instruction of the same source code line thus requiring two step/next commands to reach the previous source code line. It should only require one step/next command to reach the previous source code line. By contrast, a reverse next or step command from the first line in a function stops at the first instruction in the source code line where the call was made. The same behavior was observed on PowerPC. Steps to reproduce: gdb ./foo execute into a function call reverse-finish -takes you to the caller reverse-next -gdb is still a the caller source line reverse-next -gdb moves back to the previous source line. FYI, I have a patch to fix the issue. Will post patch shortly. --=20 You are receiving this mail because: You are on the CC list for the bug.=