This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]