Set a thread syncpoint at a location you specify.
idb synchronize {func | line | *addr}, thread_set [if cond]
func |
The name of a function. |
line |
A line number in a source code file. |
addr |
An address. |
thread_set |
A thread set. |
cond |
A conditional expression. Execution stops when the debugger hits the specified location and this condition evaluates to TRUE. |
This command sets a thread syncpoint.
A syncpoint is an address in code. When a thread you want to synchronize reaches the syncpoint, the debugger stops that thread and freezes it. The syncpoint is hit when all the threads being synchronized have reached the syncpoint. The debugger thaws the threads being synchronized after the hit.
Syncpoints and breakpoints have the same attributes, except that when defining a breakpoint, you can optionally specify the threads that trigger it, whereas with a syncpoint, you specify the threads you want to synchronize.
When you specify cond, the debugger evaluates the condition every time a synchronized thread arrives at the syncpoint, in the context of that thread.
The eventing thread of a syncpoint is the thread that arrives last at the syncpoint.
In the following example, the idb synchronize command sets a syncpoint on line 26. The info thread command shows that all the threads in the team are stopped at line 26.
(idb) idb synchronize 26, $currentopenmpteam Syncpoint 1 at 0x8048d0f: file /site/test/ds2.c, line 26, for threads $currentopenmpteam. (idb) r Starting program: /site/test/ds2 Syncpoint 1, main () at /site/test/ds2.c:26 26 foo(); (idb) info thread 1 initial thread 3069310336 (LWP 4837) [thawed] stopped at 0x8048d0f in main::L_main_24__par_region0_2_0 at /site/test/ds2.c:26 OpenMP team memberships: (8,0), (1,0) 2 monitoring thread 3069307824 (LWP 4838) [thawed] stopped at 0xb74333b6 in pthread_cond_timedwait@@GLIBC_2.3.2(...) from /lib/tls/libpthread-0.60.so 3 openmp thread 3069238192 (LWP 4839) [thawed] stopped at 0x8048d0f in main::L_main_24__par_region0_2_0 at /site/test/ds2.c:26 OpenMP team memberships: (8,1) 4 openmp thread 3066035120 (LWP 4840) [thawed] stopped at 0x8048d0f in main::L_main_24__par_region0_2_0 at /site/test/ds2.c:26 OpenMP team memberships: (8,2) 5 openmp thread 3063933872 (LWP 4841) [thawed] stopped at 0x8048d0f in main::L_main_24__par_region0_2_0 at /site/test/ds2.c:26 OpenMP team memberships: (8,3) * 6 openmp thread 3061832624 (LWP 4842) [thawed] stopped at 0x8048d0f in main::L_main_24__par_region0_2_0 at /site/test/ds2.c:26 OpenMP team memberships: (8,4)
Copyright © 2001-2011, Intel Corporation. All rights reserved.