bramante@matrix:~/thread$ gcc -o ./test ./test.c -lpthread
bramante@matrix:~/thread$ gdb ./test
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/bramante/thread/test...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/bramante/thread/test
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
main(): 140737354028800
[New Thread 0x7ffff77fe700 (LWP 3052)]
threadFunction1(): 140737345742592
[New Thread 0x7ffff6ffd700 (LWP 3053)]
threadFunction2(): 140737337349888
^C
Program received signal SIGINT, Interrupt.
0x00007ffff7bcc52d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
(gdb) thread apply all bt
Thread 3 (Thread 0x7ffff6ffd700 (LWP 3053)):
#0 0x00007ffff7bcc52d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00000000004006da in threadFunction2 ()
#2 0x00007ffff7bc4e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#3 0x00007ffff78f238d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x0000000000000000 in ?? ()
Thread 2 (Thread 0x7ffff77fe700 (LWP 3052)):
#0 0x00007ffff7bcc52d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x000000000040068e in threadFunction1 ()
#2 0x00007ffff7bc4e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#3 0x00007ffff78f238d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x7ffff7fe5700 (LWP 3049)):
#0 0x00007ffff7bcc52d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x0000000000400754 in main ()
(gdb)