OSDN Git Service

Don't allow more than one LWP to have `do_step' flag set at a time.
authorkevinb <kevinb>
Fri, 11 Nov 2005 20:29:57 +0000 (20:29 +0000)
committerkevinb <kevinb>
Fri, 11 Nov 2005 20:29:57 +0000 (20:29 +0000)
rda/unix/ChangeLog
rda/unix/lwp-pool.c

index 0f90771..d64c751 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-11  Kevin Buettner  <kevinb@redhat.com>
+
+       * lwp-pool.c (clear_all_do_step_flags): New function.
+       (lwp_pool_singlestep_lwp): Use it.
+
 2005-11-10  Kevin Buettner  <kevinb@redhat.com>
 
        * lwp-pool.c (mark_lwp_as_dead_but_interesting): New function.
index 4b26cc3..5e309bb 100644 (file)
@@ -1395,6 +1395,23 @@ lwp_pool_continue_lwp (struct gdbserv *serv, pid_t pid, int signal)
 }
 
 
+/* Clear the `do_step' flags for all LWPs in the hash table.  */
+
+static void
+clear_all_do_step_flags (void)
+{
+  int i;
+
+  for (i = 0; i < hash_size; i++)
+    {
+      struct lwp *l = hash[i];
+
+      if (l)
+       l->do_step = 0;
+    }
+}
+
+
 int
 lwp_pool_singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal)
 {
@@ -1406,6 +1423,12 @@ lwp_pool_singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal)
     fprintf (stderr, "lwp_pool_singlestep_lwp (%p, %d, %d)\n",
             serv, (int) lwp, signal);
 
+  /* Neither GDB nor the software singlestep code contained in RDA
+     expect more than one LWP to be stepped simultaneously.  Clear the
+     `do_step' flag in all LWPs.  The flag for the LWP that we're about
+     to step will be set later on.  */
+  clear_all_do_step_flags ();
+
   switch (l->state)
     {
     case lwp_state_uninitialized: