gdb
[deliverable/binutils-gdb.git] / gdb / infrun.c
index da2dc72a38622ef363aba0256f88008dcb0a0f79..e9d870d242c6b7380cebabaebf60efb0c1b3890f 100644 (file)
@@ -3630,9 +3630,17 @@ infrun: not switching back to stepped thread, it has vanished\n");
 
      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",
@@ -3723,7 +3731,7 @@ infrun: not switching back to stepped thread, it has vanished\n");
 
       if ((ecs->event_thread->step_over_calls == STEP_OVER_NONE)
          || ((ecs->event_thread->step_range_end == 1)
-             && in_prologue (ecs->event_thread->prev_pc,
+             && in_prologue (gdbarch, ecs->event_thread->prev_pc,
                              ecs->stop_func_start)))
        {
          /* I presume that step_over_calls is only 0 when we're
@@ -3769,10 +3777,21 @@ infrun: not switching back to stepped thread, it has vanished\n");
                  keep_going (ecs);
                  return;
                }
-             /* 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);
+             if (gdbarch_skip_trampoline_code(current_gdbarch,
+                                              get_current_frame (),
+                                              stop_pc))
+               {
+                 /* We are in a function call trampoline.
+                    Keep stepping backward to get to the caller.  */
+                 ecs->event_thread->stepping_over_breakpoint = 1;
+               }
+             else
+               {
+                 /* Normal function call return (static or dynamic).  */
+                 init_sal (&sr_sal);
+                 sr_sal.pc = ecs->stop_func_start;
+                 insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+               }
            }
          else
            insert_step_resume_breakpoint_at_caller (frame);
This page took 0.026567 seconds and 4 git commands to generate.