From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12249 invoked by alias); 28 Jun 2008 16:35:18 -0000 Received: (qmail 12239 invoked by uid 22791); 28 Jun 2008 16:35:17 -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; Sat, 28 Jun 2008 16:35:00 +0000 Received: (qmail 8860 invoked from network); 28 Jun 2008 16:34:58 -0000 Received: from unknown (HELO wind.local) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Jun 2008 16:34:58 -0000 From: Vladimir Prus Date: Sat, 28 Jun 2008 16:40:00 -0000 Subject: [MI non-stop 01/11] Report thread state in -thread-info output. To: gdb-patches@sources.redhat.com X-TUID: 0e58eaf2537ab7a4 X-Length: 981 X-UID: 260 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806282034.58776.vladimir@codesourcery.com> 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/msg00539.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 :-) - 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) + state = "exited"; + else if (tp->state_ == THREAD_RUNNING) + state = "running"; + ui_out_field_string (uiout, "state", state); + } + do_cleanups (chain2); } -- 1.5.3.5