From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5594 invoked by alias); 29 Jun 2008 00:42:40 -0000 Received: (qmail 5583 invoked by uid 22791); 29 Jun 2008 00:42:38 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 29 Jun 2008 00:42:11 +0000 Received: from kahikatea.snap.net.nz (42.60.255.123.dynamic.snap.net.nz [123.255.60.42]) by viper.snap.net.nz (Postfix) with ESMTP id 271983DA887; Sun, 29 Jun 2008 12:42:04 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 89EA18FC6D; Sun, 29 Jun 2008 12:42:00 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18534.55895.723858.908890@kahikatea.snap.net.nz> Date: Sun, 29 Jun 2008 05:33:00 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [MI non-stop 01/11] Report thread state in -thread-info output. In-Reply-To: <200806282034.58776.vladimir@codesourcery.com> References: <200806282034.58776.vladimir@codesourcery.com> X-Mailer: VM 7.19 under Emacs 22.2.50.3 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/msg00568.txt.bz2 > This patch adds the 'state' field to the output of -thread-info. Since > it only changes MI behaviour, I guess I don't need it approved, and > it seems fairly trivial so I doubt we'll have much discussion of this one :-) But this isn't a self contained patch, it seems to need changes in the last of the series [MI non-stop 10/11]. ISTR that Pedro cascaded his patches so that it was possible to look at one change after the other. > - Volodya > > * thread.c (print_thread_info): Add new field "state". > --- > gdb/thread.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/gdb/thread.c b/gdb/thread.c > index d0e17c5..4e172d8 100644 > --- a/gdb/thread.c > +++ b/gdb/thread.c > @@ -806,6 +806,16 @@ print_thread_info (struct ui_out *uiout, int requested_thread) > LOCATION); > } > > + if (ui_out_is_mi_like_p (uiout)) > + { > + char *state = "stopped"; > + if (tp->state_ == THREAD_EXITED) ^^^^^^^^^^ ^^^^^^^^^^^^^ Not defined here. > + state = "exited"; > + else if (tp->state_ == THREAD_RUNNING) > + state = "running"; > + ui_out_field_string (uiout, "state", state); > + } > + > do_cleanups (chain2); > } > > -- > 1.5.3.5 > > -- Nick http://www.inet.net.nz/~nickrob