--- infrun.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) --- a/infrun.c +++ b/infrun.c @@ -3465,13 +3465,34 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( if (pc_after_resolver) { - /* Set up a step-resume breakpoint at the address - indicated by SKIP_SOLIB_RESOLVER. */ struct symtab_and_line sr_sal; - init_sal (&sr_sal); - sr_sal.pc = pc_after_resolver; + if (execution_direction == EXEC_REVERSE) + { + if (ecs->stop_func_start != stop_pc) + { + /* Normal (staticly linked) function call return. */ + init_sal (&sr_sal); + sr_sal.pc = ecs->stop_func_start; + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + } + else + { + /* We are stepping over a function call in reverse, and + stop at the start address of the function. Go back to + single-stepping, which should take us back to the + function call. */ + ecs->event_thread->stepping_over_breakpoint = 1; + } + } + else + { + /* Set up a step-resume breakpoint at the address + indicated by SKIP_SOLIB_RESOLVER. */ + init_sal (&sr_sal); + sr_sal.pc = pc_after_resolver; - insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + } } keep_going (ecs);