public inbox for
 help / color / mirror / Atom feed
From: Kevin Buettner <>
Subject: [commit] Don't allow more than one LWP to have `do_step' flag set at a time
Date: Fri, 11 Nov 2005 20:47:00 -0000	[thread overview]
Message-ID: <20051111134740.476d522d@ironwood.lan> (raw)

I've just committed the patch below.  As indicated by the comment, the
software singlestep code internal to RDA does not expect to step more
than one thread at a time.  (It's rather naive about how it saves the
singlestep breakpoints.)  I considered making it more robust, it seems
to me that GDB only expects one thread to be singlestepped at a time.
At the present time, I don't think there's any functionality to be gained
by allowing more than one thread to singlestep simultaneously.

	* lwp-pool.c (clear_all_do_step_flags): New function.
	(lwp_pool_singlestep_lwp): Use it.

Index: lwp-pool.c
RCS file: /cvs/src/src/rda/unix/lwp-pool.c,v
retrieving revision 1.5
diff -u -p -r1.5 lwp-pool.c
--- lwp-pool.c	10 Nov 2005 21:32:15 -0000	1.5
+++ lwp-pool.c	11 Nov 2005 20:26:23 -0000
@@ -1395,6 +1395,23 @@ lwp_pool_continue_lwp (struct gdbserv *s
+/* 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;
+    }
 lwp_pool_singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal)
@@ -1406,6 +1423,12 @@ lwp_pool_singlestep_lwp (struct gdbserv 
     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:

                 reply	other threads:[~2005-11-11 20:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051111134740.476d522d@ironwood.lan \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).