aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-09-17 07:09:35 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-09-17 07:09:35 +0000
commitacf9414f48577b03f303c70f504383709db6a249 (patch)
tree56b3aacf2b20c7fc0604e643828216ad627f160f /gdb/infrun.c
parent193facb37dbdf7a969ac8c581ec9b3158cfef7ee (diff)
downloadgdb-acf9414f48577b03f303c70f504383709db6a249.zip
gdb-acf9414f48577b03f303c70f504383709db6a249.tar.gz
gdb-acf9414f48577b03f303c70f504383709db6a249.tar.bz2
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.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index cbab993..20207ed 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4902,14 +4902,22 @@ process_event_stop_test:
if (execution_direction == EXEC_REVERSE)
{
- 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);
+ /* 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);
+ }
}
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