From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16994 invoked by alias); 25 Jun 2008 19:44:33 -0000 Received: (qmail 16985 invoked by uid 22791); 25 Jun 2008 19:44:32 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 25 Jun 2008 19:44:12 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id EC8CA9835A; Wed, 25 Jun 2008 19:44:10 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id C2B179810F; Wed, 25 Jun 2008 19:44:10 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KBauY-0007x7-0d; Wed, 25 Jun 2008 15:44:10 -0400 Date: Wed, 25 Jun 2008 20:06:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [non-stop] 07/10 non-stop inferior control Message-ID: <20080625194409.GF25575@caradoc.them.org> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <200806152205.16824.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200806152205.16824.pedro@codesourcery.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00451.txt.bz2 On Sun, Jun 15, 2008 at 10:05:16PM +0100, Pedro Alves wrote: > It is also needed to have support to interrupt/suspend a simple > thread so a new target_stop_ptid method was added to request > the target to interrupt a single thread. How about adding a ptid argument to to_stop instead? I think the code will be shared in most cases. > @@ -1810,11 +1847,16 @@ handle_inferior_event (struct execution_ > && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event) > add_thread (ecs->ptid); > > - /* Mark all threads as not-executing. In non-stop, this should be > - adjusted to only mark ecs->ptid. */ > - if (ecs->ws.kind != TARGET_WAITKIND_IGNORE > - && stop_soon != STOP_QUIETLY) > - set_executing (pid_to_ptid (-1), 0); > + if (ecs->ws.kind != TARGET_WAITKIND_IGNORE) > + { > + /* Mark the stopped threads accordingly. */ > + if (!non_stop > + || ecs->ws.kind == TARGET_WAITKIND_EXITED > + || ecs->ws.kind == TARGET_WAITKIND_SIGNALLED) > + set_executing (pid_to_ptid (-1), 0); > + else > + set_executing (ecs->ptid, 0); > + } > > switch (ecs->ws.kind) > { Are we going to miss the stop_soon check here? > - switch_to_thread (tp->ptid); > + if (non_stop) > + context_switch_to (tp->ptid); > + else > + switch_to_thread (tp->ptid); > + Ow ow my head, I really wish we didn't need both of these. We'll never keep track of which is which. Will we eventually be able to merge them? > - add_prefix_cmd ("thread", class_run, thread_command, _("\ > + c = add_prefix_cmd ("thread", class_run, thread_command, _("\ > Use this command to switch between threads.\n\ > The new thread ID must be currently known."), > &thread_cmd_list, "thread ", 1, &cmdlist); Indentation on that last line. Otherwise OK. -- Daniel Jacobowitz CodeSourcery