diff options
author | Pedro Alves <palves@redhat.com> | 2016-01-13 10:56:09 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-01-13 11:02:05 +0000 |
commit | c84f6bbfe50ff13928360d3cc349d7c553867ce6 (patch) | |
tree | 70623a4c2386a9dd3a89a281fd087dc029aa7912 /gdb/testsuite | |
parent | 22a0232400ea09c57ab70d97cffc1f25e6320da7 (diff) | |
download | gdb-c84f6bbfe50ff13928360d3cc349d7c553867ce6.zip gdb-c84f6bbfe50ff13928360d3cc349d7c553867ce6.tar.gz gdb-c84f6bbfe50ff13928360d3cc349d7c553867ce6.tar.bz2 |
Implement "info threads -gid"
This commit makes global thread IDs optionaly visible in "info
threads", with the new "-gid" switch:
(gdb) info threads -gid
Id GId Target Id Frame
1.1 1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running)
1.2 3 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running)
1.3 4 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running)
2.1 2 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running)
2.2 5 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running)
* 2.3 6 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running)
(gdb) info threads
Id Target Id Frame
1.1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running)
1.2 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running)
1.3 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running)
2.1 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running)
2.2 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running)
* 2.3 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running)
No regressions on x86_64 Fedora 20.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* NEWS: Mention "info threads -gid".
* gdbthread.h (struct thread_info) <global_num>: Mention "info
threads -gid".
* thread.c (info_threads_command): Handle "-gid".
(_initialize_thread): Adjust "info threads" help string to mention
-gid.
gdb/testsuite/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* gdb.multi/tids.exp: Test "info threads -gid".
gdb/doc/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Threads): Document "info threads -gid".
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.multi/tids.exp | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 92989a9..c863518 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2016-01-13 Pedro Alves <palves@redhat.com> + * gdb.multi/tids.exp: Test "info threads -gid". + +2016-01-13 Pedro Alves <palves@redhat.com> + * gdb.multi/tids.exp: Test InferiorThread.global_num and Breakpoint.thread. * gdb.python/py-infthread.exp: Test InferiorThread.global_num. diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp index 6895f3c..b0c768f 100644 --- a/gdb/testsuite/gdb.multi/tids.exp +++ b/gdb/testsuite/gdb.multi/tids.exp @@ -150,6 +150,14 @@ with_test_prefix "two inferiors" { info_threads "" "1.1 1.2 2.1 2.2" \ "info threads again" + # Same, but show the global ID. + gdb_test "info threads -gid" \ + [multi_line \ + " 1\.1 +1 +.*" \ + "\\* 1\.2 +4 +.* thread_function1 .* at .*$srcfile:.*" \ + " 2\.1 +2 +.*" \ + " 2\.2 +3 +.* thread_function1 .* at .*$srcfile:.*"] + # Confirm the convenience variable show the expected number. gdb_test "p \$_thread == 2" " = 1" |