| Article Index |
|---|
| GDB UPC Sample Sessions |
| Multiple Unix Processes |
| Single Unix Process |
| Multiple Posix Threads |
| Single Thread Debugging |
| All Pages |
Page 5 of 5
Single Thread Debugging
There are situations where the user needs to debug a single thread out of many UPC threads. This can be achieved by switching from GDB UPC's upc mode into the regular gdb mode. For example:
(
with-upc-pts=struct
(gdb-upc) set upcmode off
UPC Mode de-activated.
(gdb) thread 3
[Switching to thread 3 (UPC Thread 1)]#0· \
main () at upc-example.upc:23
23 if (!MYTHREAD)<
(gdb) n
27 upc_barrier;
(gdb)info threads
5 UPC Thread 3 main () at upc-example.upc:23
4 UPC Thread 2 main () at upc-example.upc:23
* 3 UPC Thread 1 main () at upc-example.upc:27
2 UPC Thread 0 main () at upc-example.upc:23
1 UPC MONITOR 0x0000003d51007fbd in \
pthread_join () from /lib64/libpthread.so.0
(gdb)
As seen from above example, only a single UPC thread (UPC thread number 1) is advanced for one source instruction. Note that in GDB mode GDB thread numbers must be used.








