This is the mail archive of the gdb@sourceware.org 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: Q: GDB - Threads


Hi, still strugling to DEBUG threads...


I ' got a hint from someone that told me. 

A) I should check if my libpthread.so.0 if it is not stripped.

And it isn't ..  

arm-linux-uclibc-nm libpthread-0.9.30.1.so 
00012cf4 a _DYNAMIC
00012dbc a _GLOBAL_OFFSET_TABLE_
         w _Jv_RegisterClasses
00012ce4 d __CTOR_END__
00012cdc d __CTOR_LIST__
00012cec d __DTOR_END__
00012ce8 d __DTOR_LIST__
0000a25c r __EH_FRAME_BEGIN__
...... < removed some stuff here >>


B) that there should be a mismatch between libthread.so.0 and libthread_db.so.1
Both libs have been build on the same system.. (buildroot).. 
Even started from scratch.... 
 88 -rw-r--r--  1 noel noel  82178 2009-06-02 16:23 libpthread-0.9.30.1.so
  0 lrwxrwxrwx  1 noel noel     22 2009-06-02 16:23 libpthread.so.0 -> libpthread-0.9.30.1.so

 16 -rw-r--r--  1 noel noel  13171 2009-06-02 16:23 libthread_db-0.9.30.1.so
  0 lrwxrwxrwx  1 noel noel     24 2009-06-02 16:23 libthread_db.so.1 -> libthread_db-0.9.30.1.so




Still not able to debug a MT-application :-( 

Anyone that can help me 'little' further ??


Ref to :  http://sourceware.org/ml/gdb/2009-05/msg00137.html



Kind regards Noel.



-----Original Message-----
From: Hui Zhu [mailto:teawater@gmail.com] 
Sent: 27May09 00:08
To: Vellemans, Noel
Cc: gdb@sourceware.org
Subject: Re: Q: GDB - Threads

http://sourceware.org/gdb/current/onlinedocs/gdb_5.html#SEC28
http://sourceware.org/gdb/wiki/FAQ

GDB does not see any threads besides the one in which crash occurred; or SIGTRAP kills my program when I set a breakpoint.

    * This frequently happen on Linux, especially on embedded targets.
There are two common causes:
          o

            you are using glibc, and you have stripped libpthread.so.0
          o

            mismatch between libpthread.so.0 and libthread_db.so.1

      GDB itself does not know how to decode "thread control blocks"
maintained by glibc and considered to be glibc private implementation detail. It uses libhread_db.so.1 (part of glibc) to help it do so.
Therefore, libthread_db.so.1 and libpthread.so.0 must match in version and compilation flags.

      In addition, libthread_db.so.1 requires certain non-global symbols to be present in libpthread.so.0.

      Solution: use strip --strip-debug libpthread.so.0 instead of strip libpthread.so.0.




On Wed, May 27, 2009 at 00:02, Vellemans, Noel <Noel.Vellemans@visionbms.com> wrote:
>
> Hi,
>
> Somebody who can point me to a document (URL) that contains some info 
> about GDB-(server)debugging with threads ?
>
> I'm having problems debugging multithread applications (compiled for 
> ARM).
>
>
> Ref to : ?http://sourceware.org/ml/gdb/2009-05/msg00137.html
>
>
>
> GDB-6.8 (for ARM).
>
> /toolchain_build_arm/gdbhost-6.8/gdb$ ./gdb --v GNU gdb 6.8 Copyright 
> (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. ?Type "show 
> copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i386-pc-linux-gnu 
> --target=arm-linux-uclibc".
>
>
>
>
>
>
>
>
> Kind Regards,
> Noel.
>
>
>


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