Set the execution attribute of the specified threads to frozen.
idb freeze [thread_set]
thread_set |
A thread set. |
This command sets the execution attribute of the specified threads to frozen. If you do not specify any threads, the debugger uses the current thread.
A frozen thread does not resume when you resume executing a set of threads in the job.
To specify a thread set, use proper thread set notation. For example, to freeze thread 2, enter the following command:
idb freeze t:[2]
Notice that all OpenMP* threads begin at line 8 of demo.c.
(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)
First, the idb uninterrupt command sets thread 2 to run without stopping for events. The idb target thread command targets the last eventing thread, thread 6, for any mover commands. Omitting this command and entering next would cause the debugger to try to advance all OpenMP threads, which would result in a warning and cause the debugger to abort the command.
(idb) idb uninterrupt t:[2] (idb) idb target thread $lasteventingthread
The idb freeze command sets threads 2, 3, 4 and 5 to freeze, but thread 6 is still thawed.
(idb) idb freeze t:[1,3,4,5] (idb) next 10 if (i % 2) { (idb) next 13 i--;
The first next command advances all thawed threads, which in this case is only thread 6. Notice that thread 2 is not affected by next because it did not stop executing. Thread 6 is now at line 13, while the frozen threads remain at line 8.
Notice that info threads only displays threads that are not currently executing, and because thread 2 is set to uninterrupt, it does not appear in the output of info threads.
(idb) info thread
1 initial thread 3074269856 (LWP 28383) [frozen] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,0), (1,0)
3 openmp thread 3074194352 (LWP 28385) [frozen] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,1)
4 openmp thread 3070229424 (LWP 28386) [frozen] stopped at 0x80487a6 in foo at /site/test/demo.c:8 OpenMP team memberships: (8,2)
5 openmp thread 3068128176 (LWP 28387) [frozen] 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 0x80487c6 in foo at /site/test/demo.c:13 OpenMP team memberships: (8,4)
The idb thaw command thaws the frozen threads, and next advances all the threads one line. Thread 6 remains one line ahead of threads 1, 3, 4 and 5.
(idb) idb thaw t:[1,3,4,5] (idb) idb target threads $currentopenmpteam (idb) next 16 return; (idb) info thread 1 initial thread 3074269856 (LWP 28383) [thawed] stopped at 0x80487ac in foo at /site/test/demo.c:10 OpenMP team memberships: (8,0), (1,0) 3 openmp thread 3074194352 (LWP 28385) [thawed] stopped at 0x80487ac in foo at /site/test/demo.c:10 OpenMP team memberships: (8,1) 4 openmp thread 3070229424 (LWP 28386) [thawed] stopped at 0x80487ac in foo at /site/test/demo.c:10 OpenMP team memberships: (8,2) 5 openmp thread 3068128176 (LWP 28387) [thawed] stopped at 0x80487ac in foo at /site/test/demo.c:10 OpenMP team memberships: (8,3) * 6 openmp thread 3066026928 (LWP 28388) [thawed] stopped at 0x80487c9 in foo at /site/test/demo.c:16 OpenMP team memberships: (8,4)
Copyright © 2001-2011, Intel Corporation. All rights reserved.