This little patch adds a periodically-requested convenience variable whose value is the current thread. It's handy in scripts and conditionals, since the GDB-assigned thread id is unpredictable. Although the original request was for "$thread", it might be better to make it "$_thread" instead, so as not to interfere with possible use in existing scripts. But I'll only change it if I get enough votes in favor. :-) Stan 2010-06-13 Stan Shebs * thread.c (thread_id_make_value): Make a value representing the current thread. (_initialize_thread): Create $thread. * gdb.texinfo (Debugging Programs with Multiple Threads): Describe $thread. * gdb.threads/thread-specific.exp: Add tests of $thread.