diff -Nru gdb-7.0.1/gdb/thread.c gdb-7.0.1-1/gdb/thread.c --- gdb-7.0.1/gdb/thread.c 2009-09-13 17:28:28.000000000 +0100 +++ gdb-7.0.1-1/gdb/thread.c 2010-02-03 17:01:26.000000000 +0000 @@ -311,6 +311,18 @@ return NULL; } +struct thread_info * +find_thread_lwp (int num) +{ + struct thread_info *tp; + + for (tp = thread_list; tp; tp = tp->next) + if (tp->ptid.lwp == num) + return tp; + + return NULL; +} + /* Find a thread_info by matching PTID. */ struct thread_info * find_thread_ptid (ptid_t ptid) @@ -1164,11 +1176,19 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr) { int num; + char *tidstring=(char *)tidstr; struct thread_info *tp; - num = value_as_long (parse_and_eval (tidstr)); - - tp = find_thread_id (num); + if (tidstring[0] == '%') + { + num = value_as_long (parse_and_eval ((void *)(tidstring+1))); + tp = find_thread_lwp (num); + } + else + { + num = value_as_long (parse_and_eval (tidstr)); + tp = find_thread_id (num); + } if (!tp) error (_("Thread ID %d not known."), num);