Test case for Inferior.thread_from_thread_handle
authorKevin Buettner <kevinb@redhat.com>
Thu, 5 May 2016 19:39:36 +0000 (12:39 -0700)
committerKevin Buettner <kevinb@redhat.com>
Thu, 21 Sep 2017 18:49:48 +0000 (11:49 -0700)
commit757bf54bb48a8417154cfdd7128c1775d43478d8
treef6513023423e4d9c6df9c4bfa08dc2b959f25e6e
parentf2ff95c5837bd41848e7156aa2677498518d0d18
Test case for Inferior.thread_from_thread_handle

As the title says, this is a test case for
Inferior.thread_from_thread_handle, a python method which will,
given a thread library dependent thread handle, find the GDB thread
which corresponds to that thread handle (in the inferior under
consideration).

The C file for this test case causes the thread handles for the
main thread and two child threads to be placed into an array.  The
test case runs to one of the functions (do_something()) at which point,
it retrieves the thread handles from the array and attempts to find the
corresponding thread in GDB's internal thread list.

I use barriers to make sure that both threads have actually started;
execution will stop when one of the threads breaks at do_something.

Thanks to Simon Marchi for suggestions for forcing the thread
numbering to be stable.

gdb/testsuite/ChangeLog:

* gdb.python/py-thrhandle.c, gdb.python/py-thrhandle.exp: New
files.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-thrhandle.c [new file with mode: 0644]
gdb/testsuite/gdb.python/py-thrhandle.exp [new file with mode: 0644]
This page took 0.024157 seconds and 4 git commands to generate.