Add $_gthread convenience variable
authorPedro Alves <palves@redhat.com>
Wed, 13 Jan 2016 10:56:10 +0000 (10:56 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 13 Jan 2016 11:03:19 +0000 (11:03 +0000)
commit663f6d42f47265d2deaa86c8a976e658fb13f820
treebd245ce035bd243e40c05056a39ee0d28e8bc3c5
parentc84f6bbfe50ff13928360d3cc349d7c553867ce6
Add $_gthread convenience variable

This commit adds a new $_gthread convenience variable, that is like
$_thread, but holds the current thread's global thread id.

gdb/ChangeLog:
2016-01-13  Pedro Alves  <palves@redhat.com>

* NEWS: Mention $_gthread.
* gdbthread.h (struct thread_info) <global_num>: Mention
$_gthread.
* thread.c (thread_num_make_value_helper): New function.
(thread_id_make_value): Delete.
(thread_id_per_inf_num_make_value, global_thread_id_make_value):
New.
(thread_funcs): Adjust.
(gthread_funcs): New.
(_initialize_thread): Register $_gthread variable.

gdb/testsuite/ChangeLog:
2016-01-13  Pedro Alves  <palves@redhat.com>

* gdb.base/default.exp: Expect $_gthread as well.
* gdb.multi/tids.exp: Test $_gthread.
* gdb.threads/thread-specific.exp: Test $_gthread.

gdb/doc/ChangeLog:
2016-01-13  Pedro Alves  <palves@redhat.com>

* gdb.texinfo (Threads): Document the $_gthread convenience
variable.
(Convenience Vars): Likewise.
gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/gdbthread.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.multi/tids.exp
gdb/testsuite/gdb.threads/thread-specific.exp
gdb/thread.c