Bug 14548 - reverse: cannot step-over jmp-only-functions
Summary: reverse: cannot step-over jmp-only-functions
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 7.5
Assignee: Jan Kratochvil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-06 08:59 UTC by Jan Kratochvil
Modified: 2012-09-17 07:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
testcase.c (121 bytes, text/plain)
2012-09-06 08:59 UTC, Jan Kratochvil
Details
non-regression-tested GDB fix (404 bytes, patch)
2012-09-06 09:02 UTC, Jan Kratochvil
Details | Diff
Unrelated fix (for myself) for gcc >= 4.7 (251 bytes, patch)
2012-09-06 09:03 UTC, Jan Kratochvil
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2012-09-06 08:59:55 UTC
Created attachment 6625 [details]
testcase.c

formerly: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54405

gdb ./a.out -ex start -ex record -ex next -ex next -ex 'set debug infrun 1' -ex reverse-next

FAIL:
No more reverse-execution history.
main () at 12.c:18
18	  v = 1;

PASS:
19	  f ();

You should compile it with gcc < 4.7 (such as FSF GCC 4.6) to avoid another bug.
Comment 1 Jan Kratochvil 2012-09-06 09:02:09 UTC
Created attachment 6626 [details]
non-regression-tested GDB fix
Comment 2 Jan Kratochvil 2012-09-06 09:03:32 UTC
Created attachment 6627 [details]
Unrelated fix (for myself) for gcc >= 4.7
Comment 3 Jan Kratochvil 2012-09-12 18:05:12 UTC
Comment on attachment 6627 [details]
Unrelated fix (for myself) for gcc >= 4.7

Included instead in:
[patch+7.5?] Fix GDB-return into TAILCALL_FRAME (PR 14119)
http://sourceware.org/ml/gdb-patches/2012-09/msg00218.html
Comment 4 Sourceware Commits 2012-09-17 07:09:43 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	jkratoch@sourceware.org	2012-09-17 07:09:35

Modified files:
	gdb            : ChangeLog infrun.c 
	gdb/testsuite  : ChangeLog 
Added files:
	gdb/testsuite/gdb.reverse: singlejmp-reverse-nodebug.S 
	                           singlejmp-reverse-nodebug.c 
	                           singlejmp-reverse.S 
	                           singlejmp-reverse.c 
	                           singlejmp-reverse.exp 

Log message:
	gdb/
	PR 14548
	* infrun.c (handle_inferior_event): Do not reverse-continue back to the
	function start if we are already at function start.  Both for
	reverse-next and for reverse-step into function without line number
	info.
	
	gdb/testsuite/
	PR 14548
	* gdb.reverse/singlejmp-reverse-nodebug.S: New file.
	* gdb.reverse/singlejmp-reverse-nodebug.c: New file.
	* gdb.reverse/singlejmp-reverse.S: New file.
	* gdb.reverse/singlejmp-reverse.c: New file.
	* gdb.reverse/singlejmp-reverse.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14662&r2=1.14663
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infrun.c.diff?cvsroot=src&r1=1.557&r2=1.558
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3374&r2=1.3375
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse-nodebug.S.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse-nodebug.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse.S.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp.diff?cvsroot=src&r1=NONE&r2=1.1
Comment 5 Sourceware Commits 2012-09-17 07:15:01 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_5-branch
Changes by:	jkratoch@sourceware.org	2012-09-17 07:14:56

Modified files:
	gdb            : ChangeLog infrun.c 
	gdb/testsuite  : ChangeLog 
Added files:
	gdb/testsuite/gdb.reverse: singlejmp-reverse-nodebug.S 
	                           singlejmp-reverse-nodebug.c 
	                           singlejmp-reverse.S 
	                           singlejmp-reverse.c 
	                           singlejmp-reverse.exp 

Log message:
	gdb/
	PR 14548
	* infrun.c (handle_inferior_event): Do not reverse-continue back to the
	function start if we are already at function start.  Both for
	reverse-next and for reverse-step into function without line number
	info.
	
	gdb/testsuite/
	PR 14548
	* gdb.reverse/singlejmp-reverse-nodebug.S: New file.
	* gdb.reverse/singlejmp-reverse-nodebug.c: New file.
	* gdb.reverse/singlejmp-reverse.S: New file.
	* gdb.reverse/singlejmp-reverse.c: New file.
	* gdb.reverse/singlejmp-reverse.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.14469.2.31&r2=1.14469.2.32
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infrun.c.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.549&r2=1.549.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=1.3295.2.21&r2=1.3295.2.22
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse-nodebug.S.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse-nodebug.c.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse.S.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse.c.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp.diff?cvsroot=src&only_with_tag=gdb_7_5-branch&r1=NONE&r2=1.1.2.1
Comment 6 Jan Kratochvil 2012-09-17 07:22:20 UTC
Checked in for 7.5.1.