From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3382 invoked by alias); 14 Jul 2008 15:01:25 -0000 Received: (qmail 3373 invoked by uid 22791); 14 Jul 2008 15:01:24 -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; Mon, 14 Jul 2008 15:01:06 +0000 Received: (qmail 1143 invoked from network); 14 Jul 2008 15:01:04 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Jul 2008 15:01:04 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [MI non-stop 01/11] Report thread state in -thread-info output. Date: Mon, 14 Jul 2008 15:01:00 -0000 User-Agent: KMail/1.9.9 Cc: Vladimir Prus References: <200806282034.58776.vladimir@codesourcery.com> <20080711134159.GC2651@caradoc.them.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807141601.03909.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-07/txt/msg00279.txt.bz2 A Sunday 13 July 2008 06:38:50, Vladimir Prus wrote: > Daniel Jacobowitz wrote: > > On Sat, Jun 28, 2008 at 08:34:58PM +0400, Vladimir Prus wrote: > >> + if (tp->state_ == THREAD_EXITED) > >> + state = "exited"; > > > > /* This field is internal to thread.c. Never access it directly, > > use is_running instead. */ > > int state_; > > > > Aren't there accessors you can use here? > > Well, we talked with Pedro about this, I believe. The issue now is that > is_xxx function take ptid, and do lookup. The right solution would be to > have is_xxx_ptid functions taking ptid and is_xxx functions taking > thread_info*. > > Pedro, does this approach seem OK for you, in the end? Sure, that, or is_ptid_STATE/is_thread_STATE, or rename state_ to state and allow access to it directly when we have a thread_info (or adding a thread_state(thread_info) accessor and make the state enum public). The main reason is_$(STATE) were introduced, the member was named state_ and accessing it directly was noted as forbidden, was because of targets that don't record the main thread. Any approach taken is fine with me. -- Pedro Alves