gdb can't start linuxthreads

gdb can't start linuxthreads

Post by Christian Casteyd » Tue, 23 May 2000 04:00:00



Hi,

I'm writing a pgm that uses threads, but I can't manage to start it in gdb.
When I run it, it catch a "unknown signal", then is completely locked.

I tried to recompile gdb 5.0, but it still does nothing (on a SuSE
(glibc2.1.3, kernel 2.2.15)).
It catch a "SIG32 realtime" signal, then only lauch the main thread (the
other one is killed ?).
I also tried on Slackware (glibc2.1.3, kernel 2.3.99-pre6), but then gdb
crash (Segmentation fault).

How can I start a pgm with threads in gdb ?
Does gdb uses linux headers and works only on stable kernels ? Can I use it
with 2.3.99 kernels ?

Note : I made a test program with 2 threads, one that prints As and the
other Bs,
it works, but I got only As in gdb if it doesn't crash.

Thank you

 
 
 

gdb can't start linuxthreads

Post by Christian Casteyd » Wed, 24 May 2000 04:00:00


I found the beast.
I had recompiled my glibc2.1.3 against 2.3.99 headers, and it was certainly
not ready.
I recompiled gdb and glibc against  2.2.15 headers, and now everything seems
to work fine.



Quote:> Hi,

> I'm writing a pgm that uses threads, but I can't manage to start it in
gdb.
> When I run it, it catch a "unknown signal", then is completely locked.

> I tried to recompile gdb 5.0, but it still does nothing (on a SuSE
> (glibc2.1.3, kernel 2.2.15)).
> It catch a "SIG32 realtime" signal, then only lauch the main thread (the
> other one is killed ?).
> I also tried on Slackware (glibc2.1.3, kernel 2.3.99-pre6), but then gdb
> crash (Segmentation fault).

> How can I start a pgm with threads in gdb ?
> Does gdb uses linux headers and works only on stable kernels ? Can I use
it
> with 2.3.99 kernels ?

> Note : I made a test program with 2 threads, one that prints As and the
> other Bs,
> it works, but I got only As in gdb if it doesn't crash.

> Thank you


 
 
 

1. gdb + linuxthreads + kernel 2.2.x = fixed :)

After two solid days of differential testing, I found the problem that was
preventing me from debugging of threads under gdb.  It isn't kernel version
related, but it is rather strange so I thought I would share it for the
common curiosity...

It appears that if you are trying to debug a program that links to
libpthread.so, and the symbols for that library are not loaded, the
debugging doesn't work.  In my case, I was doing a "set auto-solib-add 0",
to avoid wading through all the libc and other system library stuff, and/or
getting messages from ddd about no source files, ending up in "space" etc.
Apparently, because the symbols for libpthread weren't loaded, the debugging
was not working properly.

Doing a manual load on the library using "sharedlibrary libpthread" solves
the problem.  Threads are then detected and debuggable (?!).

Does anyone know if this behavior is "by design" or "by accident" ?

Thank you very much to the people who responded to my original post.

regards,

Paul Archard
-------------

workfire // reveal the
.com      // email address!

2. ipv4: move proc stuff from net/ipv4/af_inet.c to net/ipv4/proc.c

3. FYI: gdb-4.17 support for LinuxThread debugging

4. UnixWare installation

5. GDB and LinuxThreads

6. write(2) and lack of disk space?

7. gdb + linuxthreads + kernel 2.2.x = broken

8. To start the software automatically

9. It's not bad canned meat...

10. Question about 'LinuxThreads'

11. how 2 get ethernet 're-started'/started?

12. Gdb can't print functions returning 'double'