public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29927] New: reverse-finish requires two reverse next instructions to reach previous source line
@ 2022-12-21 16:56 cel at us dot ibm.com
  2023-01-11 19:08 ` [Bug gdb/29927] " cel at us dot ibm.com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: cel at us dot ibm.com @ 2022-12-21 16:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29927

            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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-17 16:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 16:56 [Bug gdb/29927] New: reverse-finish requires two reverse next instructions to reach previous source line cel at us dot ibm.com
2023-01-11 19:08 ` [Bug gdb/29927] " cel at us dot ibm.com
2023-01-11 19:12 ` cel at us dot ibm.com
2023-01-17 16:47 ` cvs-commit at gcc dot gnu.org
2023-01-17 16:47 ` cvs-commit at gcc dot gnu.org
2023-01-17 16:50 ` cel at us dot ibm.com
2023-01-17 16:52 ` cel at us dot ibm.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).