diff options
author | Pedro Alves <palves@redhat.com> | 2016-01-13 10:56:08 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-01-13 11:00:54 +0000 |
commit | 22a0232400ea09c57ab70d97cffc1f25e6320da7 (patch) | |
tree | 795f4c5f87e23dea3bffb5c17cdb6f142f2401de /gdb/testsuite/gdb.python/py-infthread.exp | |
parent | 5d5658a1d3c3eb2a09c03f2f0662a1c01963c869 (diff) | |
download | binutils-gdb-22a0232400ea09c57ab70d97cffc1f25e6320da7.tar.gz |
Add Python InferiorThread.global_num attribute
This commit adds a new Python InferiorThread.global_num attribute.
This can be used to pass the correct thread ID to Breakpoint.thread,
which takes a global thread ID, not a per-inferior thread number.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* NEWS: Mention InferiorThread.global_num.
* python/py-infthread.c (thpy_get_global_num): New function.
(thread_object_getset): Register "global_num".
gdb/testsuite/ChangeLog:
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.
gdb/doc/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* python.texi (Breakpoints In Python) <Breakpoint.thread>: Add
anchor.
(Threads In Python): Document new InferiorThread.global_num
attribute.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-infthread.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-infthread.exp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp index e07fd82dfab..11f8d211a2d 100644 --- a/gdb/testsuite/gdb.python/py-infthread.exp +++ b/gdb/testsuite/gdb.python/py-infthread.exp @@ -42,6 +42,7 @@ if ![runto_main] then { gdb_py_test_silent_cmd "python t0 = gdb.selected_thread ()" "test gdb.selected_thread" 1 gdb_test "python print (t0)" "\\<gdb.InferiorThread object at 0x\[\[:xdigit:\]\]+>" "verify InferiorThread object" gdb_test "python print ('result = %s' % t0.num)" " = 1" "test InferiorThread.num" +gdb_test "python print ('result = %s' % t0.global_num)" " = 1" "test InferiorThread.global_num" gdb_test "python print ('result = %s' % str (t0.ptid))" " = \\(\[0-9\]+, \[0-9\]+, \[0-9\]+\\)" "test InferiorThread.ptid" gdb_py_test_silent_cmd "python i0 = t0.inferior" "test InferiorThread.inferior" 1 |