gdb: stop trying to prepare displaced steps for an inferior when it returns _UNAVAILABLE
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 16 Mar 2020 21:21:55 +0000 (17:21 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 10 Jun 2020 21:26:05 +0000 (17:26 -0400)
Once we got one _UNAVAILABLE for a given inferior, don't try to prepare
other threads for displaced stepping for that inferior during this
execution of start_step_over.

gdb/displaced-stepping.h
gdb/infrun.c

index 0cb2d8c97071e97b0afb692de5afa89cf2a3ed61..835fd92086bad096ec85b4fc42db8720c81dc6ba 100644 (file)
@@ -67,6 +67,8 @@ struct displaced_step_inferior_state
   /* True if preparing a displaced step ever failed.  If so, we won't
      try displaced stepping for this inferior again.  */
   bool failed_before;
+
+  bool unavailable = false;
 };
 
 /* Per-thread displaced stepping state.  */
index 356ec40d17ac2fb4e18f670f816a2bd68e6ffea4..80a0c0ad619010a1c9bcaed7cccabe02981d0dbd 100644 (file)
@@ -1717,6 +1717,7 @@ displaced_step_prepare_throw (thread_info *tp)
                            target_pid_to_str (tp->ptid).c_str ());
 
       global_thread_step_over_chain_enqueue (tp);
+      tp->inf->displaced_step_state.unavailable = true;
 
       return DISPLACED_STEP_PREPARE_STATUS_UNAVAILABLE;
     }
@@ -1909,6 +1910,9 @@ start_step_over (void)
                        "infrun: stealing list of %d threads to step from global queue\n",
                        thread_step_over_chain_length (threads_to_step));
 
+  for (inferior *inf : all_inferiors ())
+    inf->displaced_step_state.unavailable = false;
+
   for (tp = threads_to_step; tp != NULL; tp = next)
     {
       struct execution_control_state ecss;
@@ -1960,6 +1964,12 @@ start_step_over (void)
       if (!target_is_non_stop_p () && !step_what)
        continue;
 
+      if (tp->inf->displaced_step_state.unavailable)
+       {
+         global_thread_step_over_chain_enqueue (tp);
+         continue;
+       }
+
       switch_to_thread (tp);
       reset_ecs (ecs, tp);
       keep_going_pass_signal (ecs);
This page took 0.027304 seconds and 4 git commands to generate.