From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30662 invoked by alias); 11 Nov 2005 20:47:51 -0000 Mailing-List: contact rda-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rda-owner@sourceware.org Received: (qmail 30622 invoked by uid 22791); 11 Nov 2005 20:47:48 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 11 Nov 2005 20:47:48 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id jABKlkkU003676 for ; Fri, 11 Nov 2005 15:47:46 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id jABKlkV09850 for ; Fri, 11 Nov 2005 15:47:46 -0500 Received: from localhost.localdomain (vpn50-141.rdu.redhat.com [172.16.50.141]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id jABKlkgw006767 for ; Fri, 11 Nov 2005 15:47:46 -0500 Received: from ironwood.lan (ironwood.lan [192.168.64.8]) by localhost.localdomain (8.12.11/8.12.10) with ESMTP id jABKlfh3020467 for ; Fri, 11 Nov 2005 13:47:41 -0700 Date: Fri, 11 Nov 2005 20:47:00 -0000 From: Kevin Buettner To: rda@sources.redhat.com Subject: [commit] Don't allow more than one LWP to have `do_step' flag set at a time Message-ID: <20051111134740.476d522d@ironwood.lan> Organization: Red Hat X-Mailer: Sylpheed-Claws 0.9.12cvs173.1 (GTK+ 2.4.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-q4/txt/msg00006.txt.bz2 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; + } +} + + int 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: