aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2009-01-30 18:43:05 +0000
committerVladimir Prus <vladimir@codesourcery.com>2009-01-30 18:43:05 +0000
commit592375cda9444b66538fb4811db6094e37664847 (patch)
tree5e11b34b8f122f299a9ba1b7ac6595f3d7d631ee /gdb/thread.c
parent41447f92e2151bd8fcd5f3e4b8dd5e972aec9b67 (diff)
downloadfsf-binutils-gdb-592375cda9444b66538fb4811db6094e37664847.zip
fsf-binutils-gdb-592375cda9444b66538fb4811db6094e37664847.tar.gz
fsf-binutils-gdb-592375cda9444b66538fb4811db6094e37664847.tar.bz2
PR 8145.
* thread.c (do_captured_list_thread_ids): Report the current thread id.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index 8a98b8e..1d6d9c4 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -410,6 +410,7 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
struct thread_info *tp;
int num = 0;
struct cleanup *cleanup_chain;
+ int current_thread = -1;
prune_threads ();
target_find_new_threads ();
@@ -420,11 +421,18 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
{
if (tp->state_ == THREAD_EXITED)
continue;
+
+ if (ptid_equal (tp->ptid, inferior_ptid))
+ current_thread = tp->num;
+
num++;
ui_out_field_int (uiout, "thread-id", tp->num);
}
do_cleanups (cleanup_chain);
+
+ if (current_thread != -1)
+ ui_out_field_int (uiout, "current-thread-id", current_thread);
ui_out_field_int (uiout, "number-of-threads", num);
return GDB_RC_OK;
}