This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: gdb & pthreads - the Ike and Tina of Linux dev


Hi Bryan ,

Took your testcase. Can't repeat this on Debian unstable running 2.6.11-686-smp / gcc 3.3.5 / binutils 2.15 / glibc 2.3.2 .

Whats the compiler / binutils / glibc version you are using ? There still is not enough information for anyone else to replicate this.

Also I tried it on a stock Suse 9.2 and it worked just fine.



cheers
Ramana



ramana@arnor:~/gdbthread$ gdb gdbthread
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".


(gdb) b gdbthread.cpp:31
Breakpoint 1 at 0x804877e: file gdbthread.cpp, line 31.
(gdb) run
Starting program: /home/ramana/gdbthread/gdbthread
[Thread debugging using libthread_db enabled]
[New Thread -1210399648 (LWP 25876)]
[New Thread -1210401872 (LWP 25879)]
[Switching to Thread -1210401872 (LWP 25879)]

Breakpoint 1, threadFn (arg=0x0) at gdbthread.cpp:33
33                      sleep(1);
(gdb) bt
#0  threadFn (arg=0x0) at gdbthread.cpp:33
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
#2  0xb7e8518a in clone () from /lib/tls/libc.so.6
(gdb) up
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
(gdb) down
#0  threadFn (arg=0x0) at gdbthread.cpp:33
33                      sleep(1);
(gdb) bt
#0  threadFn (arg=0x0) at gdbthread.cpp:33
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
#2  0xb7e8518a in clone () from /lib/tls/libc.so.6
(gdb) l
33                      sleep(1);
34                      if( i % 2 == 0 )
35                              puts("Tick");
36                      else
37                              puts("Tock");
38                      i++;
39              }
40      }
41
42
(gdb) l 31
26      using namespace bwutils;
27
28      void *threadFn(void *arg)
29      {
30              int i = 0;
31              while( 1 )
32              {
33                      sleep(1);
34                      if( i % 2 == 0 )
35                              puts("Tick");
(gdb) bt
#0  threadFn (arg=0x0) at gdbthread.cpp:33
#1  0xb7fccb63 in start_thread () from /lib/tls/libpthread.so.0
#2  0xb7e8518a in clone () from /lib/tls/libc.so.6
(gdb)



--
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]