This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [MI non-stop 01/11] Report thread state in -thread-info output.
- From: Nick Roberts <nickrob at snap dot net dot nz>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 29 Jun 2008 12:41:59 +1200
- Subject: Re: [MI non-stop 01/11] Report thread state in -thread-info output.
- References: <200806282034.58776.vladimir@codesourcery.com>
> 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