diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-09-17 07:09:33 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-09-17 07:09:33 +0000 |
commit | cfe1428889e3a7dc197421972e108f624e166c33 (patch) | |
tree | c11e66c9f860d08a8c7c6f6bad5dd3b29d999f01 /gdb/infrun.c | |
parent | be10277a82434cebb6ca112aaf9795070d949e8a (diff) | |
download | gdb-cfe1428889e3a7dc197421972e108f624e166c33.tar.gz |
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.c | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index cbab9933b0b..20207ed9bea 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 |