Subject: Re: gdb seems to ignore threads
To: None <felix@students.poly.edu>
From: John Gordon <mailing.lists@dial.pipex.com>
List: current-users
Date: 06/01/2003 02:27:51
Hello,

I see something similar on my PPC system using your code as well as one
of my own test cases:

---8<---

(gdb) b main
Breakpoint 1 at 0x180214c: file test_threads.c, line 20.
(gdb) b thread_execution
Breakpoint 2 at 0x18020d8: file test_threads.c, line 9.
(gdb) run
Starting program: /usr/tests/posix/simple/test_threads

Breakpoint 1, main () at test_threads.c:20
20              pthread_create (&thread, NULL, thread_execution, NULL);
(gdb) c
Continuing.
[New LWP 0]
Thread counter:0 sleeping
Thread counter:1 sleeping
Thread counter:2 sleeping
Thread counter:3 sleeping
Thread counter:4 sleeping
Thread counter:5 sleeping
Thread counter:6 sleeping
Thread counter:7 sleeping
Thread counter:8 sleeping
Thread counter:9 sleeping
thead has finished
Program exited normally.

---8<---

Interestingly, my recent work to get the remote debugging via gdbserver
works as expected with threads. This is very odd since that code was
based on the thread support in the main gdb code:

---8<---

(gdb) b main
Breakpoint 1 at 0x180214c: file test_threads.c, line 20.
(gdb) b thread_execution
Breakpoint 2 at 0x18020d8: file test_threads.c, line 9.
(gdb) c
Continuing.

Breakpoint 1, main () at test_threads.c:20
20              pthread_create (&thread, NULL, thread_execution, NULL);
(gdb) c
Continuing.

Breakpoint 2, thread_execution (p=0x0) at test_threads.c:9
9               for(i = 0; i < 10; i++){

---8<---

Rgds,
John...