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.
This commit is contained in:
Jan Kratochvil
2012-09-17 07:09:35 +00:00
parent 193facb37d
commit acf9414f48
8 changed files with 522 additions and 15 deletions

View File

@@ -4902,14 +4902,22 @@ process_event_stop_test:
if (execution_direction == EXEC_REVERSE)
{
struct symtab_and_line sr_sal;
/* If we're already at the start of the function, we've either
just stepped backward into a single instruction function,
or stepped back out of a signal handler to the first instruction
of the function. Just keep going, which will single-step back
to the caller. */
if (ecs->stop_func_start != stop_pc)
{
struct symtab_and_line sr_sal;
/* Normal function call return (static or dynamic). */
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
insert_step_resume_breakpoint_at_sal (gdbarch,
sr_sal, null_frame_id);
/* Normal function call return (static or dynamic). */
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
insert_step_resume_breakpoint_at_sal (gdbarch,
sr_sal, null_frame_id);
}
}
else
insert_step_resume_breakpoint_at_caller (frame);
@@ -4979,15 +4987,23 @@ process_event_stop_test:
if (execution_direction == EXEC_REVERSE)
{
/* Set a breakpoint at callee's start address.
From there we can step once and be back in the caller. */
struct symtab_and_line sr_sal;
/* If we're already at the start of the function, we've either just
stepped backward into a single instruction function without line
number info, or stepped back out of a signal handler to the first
instruction of the function without line number info. Just keep
going, which will single-step back to the caller. */
if (ecs->stop_func_start != stop_pc)
{
/* Set a breakpoint at callee's start address.
From there we can step once and be back in the caller. */
struct symtab_and_line sr_sal;
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
insert_step_resume_breakpoint_at_sal (gdbarch,
sr_sal, null_frame_id);
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
insert_step_resume_breakpoint_at_sal (gdbarch,
sr_sal, null_frame_id);
}
}
else
/* Set a breakpoint at callee's return address (the address