public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug record/29745] New: gdbserver doesn't record changing return address on call instructions
@ 2022-11-03 8:36 blarsen at redhat dot com
2022-11-04 11:12 ` [Bug record/29745] " cvs-commit at gcc dot gnu.org
2023-05-04 15:21 ` blarsen at redhat dot com
0 siblings, 2 replies; 3+ messages in thread
From: blarsen at redhat dot com @ 2022-11-03 8:36 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29745
Bug ID: 29745
Summary: gdbserver doesn't record changing return address on
call instructions
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: record
Assignee: unassigned at sourceware dot org
Reporter: blarsen at redhat dot com
Target Milestone: ---
Created attachment 14431
--> https://sourceware.org/bugzilla/attachment.cgi?id=14431&action=edit
minimal test
When running an inferior in the gdbserver in x86_64, the call instruction only
saves the register changes to $PC and possible parameters, it does not save the
change to the return address in the stack.
This makes it so when trying to next over a function or finish a function, GDB
sets a breakpoint on the wrong address, and may skip multiple functions instead
of just the expected one.
As an example, running the attached test I get the following output:
Temporary breakpoint 1, main () at
testsuite/outputs/gdb.reverse/step-reverse/step-reverse.c:10
10 foo ();
(gdb) record
(gdb) n
11 int x = 0;
(gdb)
12 foo ();
(gdb)
13 return 0;
(gdb) rn
12 foo ();
(gdb)
11 int x = 0;
(gdb)
No more reverse-execution history.
main () at testsuite/outputs/gdb.reverse/step-reverse/step-reverse.c:10
10 foo ();
(gdb) n
No more reverse-execution history.
main () at testsuite/outputs/gdb.reverse/step-reverse/step-reverse.c:13
13 return 0;
Notice that the final line is 13 when it should be line 11.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-04 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 8:36 [Bug record/29745] New: gdbserver doesn't record changing return address on call instructions blarsen at redhat dot com
2022-11-04 11:12 ` [Bug record/29745] " cvs-commit at gcc dot gnu.org
2023-05-04 15:21 ` blarsen at redhat dot 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).