This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] info threads takes an argument
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 10 Feb 2011 17:52:10 -0800
- Subject: [RFC] info threads takes an argument
Seems like it should be possible to inquire about a specific thread.
2011-02-10 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* thread.c (info_threads_command): Process arg as thread id.
Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.131
diff -u -p -u -p -r1.131 thread.c
--- thread.c 19 Jan 2011 17:21:36 -0000 1.131
+++ thread.c 11 Feb 2011 01:47:31 -0000
@@ -965,7 +965,16 @@ No selected thread. See `help thread'.\
static void
info_threads_command (char *arg, int from_tty)
{
- print_thread_info (uiout, -1, -1);
+ int tid = -1;
+
+ if (arg != NULL && *arg != '\0')
+ {
+ int tmp_tid = strtoul (arg, NULL, 0);
+ if (tmp_tid != 0)
+ tid = tmp_tid;
+ }
+
+ print_thread_info (uiout, tid, -1);
}
/* Switch from one thread to another. */