diff options
author | Pedro Alves <palves@redhat.com> | 2016-01-13 10:56:06 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-01-13 10:58:03 +0000 |
commit | 8465445732dc04c3fb6cf954274e12d06b274f08 (patch) | |
tree | e65ec5f892665f2e5b31daa6a41171ddb82a37b5 /gdb/testsuite | |
parent | e3940304fe75c91f99e260a89fe8c45ece7e373f (diff) | |
download | gdb-8465445732dc04c3fb6cf954274e12d06b274f08.zip gdb-8465445732dc04c3fb6cf954274e12d06b274f08.tar.gz gdb-8465445732dc04c3fb6cf954274e12d06b274f08.tar.bz2 |
Add Python InferiorThread.inferior attribute
So a script can easily get at a thread's inferior and its number.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* NEWS: Mention InferiorThread.inferior.
* python/py-infthread.c (thpy_get_inferior): New.
(thread_object_getset): Register "inferior".
gdb/testsuite/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* gdb.python/py-infthread.exp: Test InferiorThread.inferior.
gdb/doc/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* python.texi (Threads In Python): Document
InferiorThread.inferior.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-infthread.exp | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5d773ca..ec2a067 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2016-01-13 Pedro Alves <palves@redhat.com> + * gdb.python/py-infthread.exp: Test InferiorThread.inferior. + +2016-01-13 Pedro Alves <palves@redhat.com> + * gdb.base/default.exp: Expect $_inferior as well. * gdb.multi/base.exp: Test $_inferior. diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp index 6e02d02..e07fd82 100644 --- a/gdb/testsuite/gdb.python/py-infthread.exp +++ b/gdb/testsuite/gdb.python/py-infthread.exp @@ -44,6 +44,9 @@ gdb_test "python print (t0)" "\\<gdb.InferiorThread object at 0x\[\[:xdigit:\]\] gdb_test "python print ('result = %s' % t0.num)" " = 1" "test InferiorThread.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 +gdb_test "python print ('result = %s' % i0.num)" " = 1" "test Inferior.num" + gdb_py_test_silent_cmd "python name = gdb.selected_thread().name" \ "get supplied name of current thread" 1 gdb_py_test_silent_cmd "python gdb.selected_thread().name = 'hibob'" \ |