This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: threads/1662: Spawned threads don't stop when breakpoint is hit
- From: Nick Gianakas <gianakas at optonline dot net>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 1 Jun 2004 00:58:00 -0000
- Subject: Re: threads/1662: Spawned threads don't stop when breakpoint is hit
- Reply-to: Nick Gianakas <gianakas at optonline dot net>
The following reply was made to PR threads/1662; it has been noted by GNATS.
From: Nick Gianakas <gianakas@optonline.net>
To: gdb-gnats@sources.redhat.com
Cc:
Subject: Re: threads/1662: Spawned threads don't stop when breakpoint is hit
Date: Mon, 31 May 2004 20:54:45 -0400
It seems like GDB isn't attaching to the thread because it doesn't stop
if a breakpoint is placed in the thread either.
Here is a snippet of the debug session:
nick@nimble gdbtest $ gdb threadtest
GNU gdb 6.1
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 "i686-pc-linux-gnu"...Using host
libthread_db library "/lib/libthread_db.so.1".
(gdb) break main
Breakpoint 1 at 0x8048444: file threadtest.c, line 9.
(gdb) break 18
Breakpoint 2 at 0x8048488: file threadtest.c, line 18.
(gdb) run
Starting program: /home/nick/gdbtest/threadtest
Breakpoint 1, main (argc=1, argv=0xbffff6c4) at threadtest.c:9
9 printf("[ main ] Program enter.\n");
(gdb) n
[ main ] Program enter.
12 int res = pthread_create(&t, NULL, wait_thread, NULL);
(gdb) n
[ wait_thread ] Waiting in thread
Program received signal SIG32, Real-time event 32.
0x4002ba34 in pthread_getconcurrency () from /lib/libpthread.so.0
(gdb) [ wait_thread ] Waiting in thread
[ wait_thread ] Waiting in thread
[ wait_thread ] Waiting in thread
[ wait_thread ] Waiting in thread
[ wait_thread ] Waiting in thread
[ wait_thread ] Waiting in thread
[ wait_thread ] Waiting in thread
The thread's output "[ wait_thread ] Waiting in thread" continues to
print despite the debugger stopped (in main).