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]

debugging threaded apps. thread ID missing in corefile.


Regarding debugging threaded apps, gdb does not display the pthread id (ID
returned by pthread_self() ) when reading information from a corefile.

GNU gdb 6.3.50.20050504-cvs
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 "powerpc64-unknown-linux-gnu"...Using host
libthread_
db library "/lib/tls/libthread_db.so.1".

Core was generated by `./test'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/tls/libpthread.so.0...done.
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
#0  0x100007c4 in whackthestack () at test.c:76
76              *(int*)0xdeaddead = 0;     /* uncomment to test signal
handler *
/
(gdb) thread
[Current thread is 1 (process 9623)]
(gdb) thread 2
[Switching to thread 2 (process 9628)]#0  0x0ff15a64 in
__nanosleep_nocancel ()
   from /lib/tls/libc.so.6
(gdb)

Where as when debugging the program live it is able to display the pthread
id (I dont know why the ID is a negative number, could be a bug?).

GNU gdb 6.3.50.20050504-cvs
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 "powerpc64-unknown-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) br callme
Breakpoint 1 at 0x10000838: file test.c, line 83.
(gdb) r
Starting program: /home/manjo/projects/zlinux/test64
[Thread debugging using libthread_db enabled]
[New Thread -134270944 (LWP 10491)]
[New Thread -134273824 (LWP 10494)]
[Switching to Thread -134273824 (LWP 10494)]

Breakpoint 1, callme (me=0, i=0) at test.c:83
83              tid = pthread_self();
(gdb) thread 2
[Switching to thread 2 (Thread -134273824 (LWP 10494))]#0  callme (me=0,
i=0)
    at test.c:83
83              tid = pthread_self();


So the question really is, is GDB not reading the thread id from core or
the kernel not dumping r2/r13 (ppc) (address of the struct pthread) to the
core?

Thanks
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

On Mon, 6 Jun 2005, Alvin Beach wrote:

> Hello all,
>
> I don't know why or how, but after I installed gdb-debuginfo-6.3-14 I can now
> debug threaded applications.
>
> I thought I'd send this out in case someone else has run into the same problem
> I did.
>
> Alvin
>
> --
> Please reply to the list.
>


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