* infrun.c (handle_inferior_event): Check the current frame ID
[deliverable/binutils-gdb.git] / gdb / infrun.c
index 9804688d4a63d61b2167c4cf141f578297a2f9fd..1c31a846bb4b6b15e03390a47723036ffd864a16 100644 (file)
@@ -1428,7 +1428,7 @@ handle_inferior_event (struct execution_control_state *ecs)
 
     case TARGET_WAITKIND_EXECD:
       if (debug_infrun)
-        fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXECED\n");
+        fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXECD\n");
       stop_signal = TARGET_SIGNAL_TRAP;
 
       /* NOTE drow/2002-12-05: This code should be pushed down into the
@@ -2368,12 +2368,16 @@ process_event_stop_test:
       return;
     }
 
-  /* Check for subroutine calls.
+  /* Check for subroutine calls.  The check for the current frame
+     equalling the step ID is not necessary - the check of the
+     previous frame's ID is sufficient - but it is a common case and
+     cheaper than checking the previous frame's ID.
 
      NOTE: frame_id_eq will never report two invalid frame IDs as
      being equal, so to get into this block, both the current and
      previous frame must have valid frame IDs.  */
-  if (frame_id_eq (frame_unwind_id (get_current_frame ()), step_frame_id))
+  if (!frame_id_eq (get_frame_id (get_current_frame ()), step_frame_id)
+      && frame_id_eq (frame_unwind_id (get_current_frame ()), step_frame_id))
     {
       CORE_ADDR real_stop_pc;
 
This page took 0.024536 seconds and 4 git commands to generate.