mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
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.
This commit is contained in:
@ -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'" \
|
||||
|
Reference in New Issue
Block a user