From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5528 invoked by alias); 17 Dec 2009 18:38:34 -0000 Received: (qmail 5472 invoked by uid 22791); 17 Dec 2009 18:38:33 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,TVD_RCVD_IP X-Spam-Check-By: sourceware.org Received: from 207-114-238-160.static.twtelecom.net (HELO mail.stratos.com) (207.114.238.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Dec 2009 18:38:29 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Cross-platform, multithreaded debugging (x86 to ARM) with gdb and gdbserver not recognizing threads Date: Thu, 17 Dec 2009 18:38:00 -0000 Message-ID: <597A11B8CF75534EBE76656E186BF106E01401@stella.stratos.local> In-Reply-To: <8ac60eac0912171018h67548c94x1ce63904b9f6d136@mail.gmail.com> References: <597A11B8CF75534EBE76656E186BF106E0135E@stella.stratos.local> <8ac60eac0912162044k34bc2765ja16c74274141275a@mail.gmail.com> <597A11B8CF75534EBE76656E186BF106E013E6@stella.stratos.local> <8ac60eac0912171018h67548c94x1ce63904b9f6d136@mail.gmail.com> From: "Jason Machacek" To: "Paul Pluzhnikov" Cc: Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00103.txt.bz2 > You want to copy /lib/libpthread.so.0 (which should be a symlink to > /lib/libpthread-2.3.2.so) from target to host, and then: > > arm-linux-nm libpthread.so.0 | egrep 'version|threads_events' > > You should see one of: nptl_version, __linuxthreads_version or > __pthread_threads_events. Sorry about that, I misread your last message. libpthread.so isn't stripped: $ /opt/crosstool/gcc-3.4.4-glibc-2.3.2/arm-linux/bin/arm-linux-nm libpthread-0.10.so | egrep 'version|threads_events' 0000de40 r __linuxthreads_version 00018e68 b __pthread_threads_events > It is impossible to statically link libc.so.6 into an application. Perhaps > you mean that your app is linked with libc.a ? > > In general GDB may have harder time debugging statically-linked threaded > executables, and you should always prefer to link against system libraries > dynamically. Yes, I did mean that I statically linked my application with libc.a. Perhaps I'll reexamine my build environment as this may be the root of my problems with GDB. When running GDB natively on my target, I had no problems debugging my application despite it being statically linked. I'll do some tests to check whether addressing this allows gdb to recognize threads in my remote application. Thanks again, Jason