From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4963 invoked by alias); 25 Jun 2008 19:02:49 -0000 Received: (qmail 4955 invoked by uid 22791); 25 Jun 2008 19:02:48 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 25 Jun 2008 19:02:31 +0000 Received: (qmail 8844 invoked from network); 25 Jun 2008 19:02:29 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Jun 2008 19:02:29 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [non-stop] 01/10 Add "executing" property Date: Wed, 25 Jun 2008 19:13:00 -0000 User-Agent: KMail/1.9.9 Cc: Vladimir Prus References: <200806152203.14626.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200806252002.27906.pedro@codesourcery.com> 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/msg00446.txt.bz2 A Wednesday 25 June 2008 18:48:27, Vladimir Prus escreveu: > Pedro Alves wrote: > > + > > +/* Reports if thread PTID is executing. =C2=A0*/ > > +extern int is_executing (ptid_t ptid); > > I know if follows is_running, introduced by me, but I think this is not > the best interface. Say, somewhere later in this patch series we have > this function: > Right. I actually think I introduced is_running in one of those early non-stop patches :-) It goes hand in hand with set_running. By your reasoning, we should make it set_running_ptid too. > static int > proceed_thread_callback (struct thread_info *thread, void *arg) > { > if (!is_stopped (thread->ptid)) > .... > > Here, we already have thread_info, and using ptid to search for thread > again, and get its state seems not nice. How about: > > extern int is_executing (struct thread_info *thread); > extern int is_executing_ptid (ptid_t ptid); > There are actually very few places that need to check for is_executing, (frame.c, stack.c), and I don't expect much more. None of these places have a thread_info pointer around. I can change the interface, no problem with me, but in this case, we only need the ptid form currently. > static int > proceed_thread_callback (struct thread_info *thread, void *arg) > { > if (!is_stopped (thread->ptid)) > .... > and a similar change for is_running? The is_stopped method is only introduced in patch 10 actually. We could also do is_stopped_thread (struct thread_info *) instead, as I expect the ptid versions to be used more often. I'll wait for review on it (as it is the patch that will probably need more adjustement) before making interface changes, OK? --=20 Pedro Alves