This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[MI non-stop 01/11] Report thread state in -thread-info output.
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 28 Jun 2008 20:34:58 +0400
- Subject: [MI non-stop 01/11] Report thread state in -thread-info output.
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