2009-06-14 Hui Zhu Michael Snyder * infrun.c (handle_inferior_event): Improve reverse stepping through function epilogue. Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.387 diff -u -p -r1.387 infrun.c --- infrun.c 11 Jun 2009 11:57:46 -0000 1.387 +++ infrun.c 15 Jun 2009 00:45:17 -0000 @@ -3623,9 +3623,17 @@ infrun: not switching back to stepped th Note that step_range_end is the address of the first instruction beyond the step range, and NOT the address of the last instruction - within it! */ + within it! + + Note also that during reverse execution, we may be stepping + through a function epilogue and therefore must detect when + the current-frame changes in the middle of a line. */ + if (stop_pc >= ecs->event_thread->step_range_start - && stop_pc < ecs->event_thread->step_range_end) + && stop_pc < ecs->event_thread->step_range_end + && (execution_direction != EXEC_REVERSE + || frame_id_eq (get_frame_id (get_current_frame ()), + ecs->event_thread->step_frame_id))) { if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: stepping inside range [0x%s-0x%s]\n",