Specify the threads that subsequent mover commands apply to.
idb target threads target_thread_set [ only ]
target_thread_set |
A thread set. |
This command specifies the threads that subsequent mover commands apply to. Mover commands are commands that advance the application, such as step or continue.
A subsequent mover command completes when all the target threads have reached the destination the mover specifies. If you or an event interrupts the command before it completes, the command aborts.
If a target thread is frozen, the command aborts with an error message.
The debugger does not evaluate target_thread_set when you issue idb target threads. It does so before executing each subsquent mover command. For example:
(idb) set $foo = t:[1] (idb) idb target threads $foo (idb) step (idb) set $foo = t:[2] (idb) step
The first step command steps thread 1, while the the second step command steps thread 2.
The thread command specifies the thread to which non-mover commands apply, so it does not interact with this command.
The default target thread set, the set that movers use before you issue idb target threads, contains the last eventing thread to match the current mover behaviors.
To specify thread sets, use thread set notation.
In the following example, all the threads in the current team step into the function foo and stop at line 8. Compare that to the default behavior, in which only the last eventing thread would stop at line 8, while other threads would possibly stop at other lines.
Syncpoint 1, main () at /site/test/demo.c:38 38 foo(tid); (idb) info thread 1 initial thread 3074269856 (LWP 28383) [thawed] stopped at 0x804892b in main::L_main_31__par_region0_2_28 at /site/test/demo.c:38 OpenMP team memberships: (8,0), (1,0) 2 monitoring thread 3074263984 (LWP 28384) [thawed] stopped at 0xb751d3b6 in pthread_cond_timedwait@@GLIBC_2.3.2 from /lib/tls/libpthread-0.60.so 3 openmp thread 3074194352 (LWP 28385) [thawed] stopped at 0x804892b in main::L_main_31__par_region0_2_28 at /site/test/demo.c:38 OpenMP team memberships: (8,1) 4 openmp thread 3070229424 (LWP 28386) [thawed] stopped at 0x804892b in main::L_main_31__par_region0_2_28 at /site/test/demo.c:38 OpenMP team memberships: (8,2) 5 openmp thread 3068128176 (LWP 28387) [thawed] stopped at 0x804892b in main::L_main_31__par_region0_2_28 at /site/test/demo.c:38 OpenMP team memberships: (8,3) * 6 openmp thread 3066026928 (LWP 28388) [thawed] stopped at 0x804892b in main::L_main_31__par_region0_2_28 at /site/test/demo.c:38 OpenMP team memberships: (8,4) (idb) idb target thread $currentopenmpteam (idb) s foo (tid=4) at /site/test/demo.c:8 8 int i = tid; (idb) info thread 1 initial thread 3074269856 (LWP 28383) [thawed] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,0), (1,0) 2 monitoring thread 3074263984 (LWP 28384) [thawed] stopped at 0xb751d3b6 in pthread_cond_timedwait@@GLIBC_2.3.2 from /lib/tls/libpthread-0.60.so 3 openmp thread 3074194352 (LWP 28385) [thawed] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,1) 4 openmp thread 3070229424 (LWP 28386) [thawed] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,2) 5 openmp thread 3068128176 (LWP 28387) [thawed] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,3) * 6 openmp thread 3066026928 (LWP 28388) [thawed] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,4)
Copyright © 2001-2011, Intel Corporation. All rights reserved.