From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5628 invoked by alias); 3 Jun 2009 15:21:26 -0000 Received: (qmail 5618 invoked by uid 22791); 3 Jun 2009 15:21:24 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail195.messagelabs.com (HELO mail195.messagelabs.com) (85.158.138.147) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 03 Jun 2009 15:21:18 +0000 X-VirusChecked: Checked X-Env-Sender: Noel.Vellemans@visionBMS.com X-Msg-Ref: server-10.tower-195.messagelabs.com!1244042473!17404722!1 X-StarScan-Version: 6.0.0; banners=-,-,- Received: (qmail 5771 invoked from network); 3 Jun 2009 15:21:13 -0000 Received: from gateway.loepfe.com (HELO gateway.loepfe.com) (195.134.156.204) by server-10.tower-195.messagelabs.com with SMTP; 3 Jun 2009 15:21:13 -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: Q: GDB - Threads Date: Wed, 03 Jun 2009 15:21:00 -0000 Message-ID: <1531E53627F1F749B4FE809BF2A4EB67FDA316@WETMEX10.loepfe.com> In-Reply-To: <20090602193404.GA19081@caradoc.them.org> References: <1531E53627F1F749B4FE809BF2A4EB67FABA56@WETMEX10.loepfe.com> <1531E53627F1F749B4FE809BF2A4EB67FD9F52@WETMEX10.loepfe.com> <8ac60eac0906020941w3064fa70l263b316358c9e38f@mail.gmail.com> <20090602181723.GA11310@caradoc.them.org> <8ac60eac0906021134u49cf0612uc26fb04bde4a6025@mail.gmail.com> <20090602193404.GA19081@caradoc.them.org> From: "Vellemans, Noel" To: X-IsSubscribed: yes 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-06/txt/msg00031.txt.bz2 I'm here again... Tried all suggestions... but still not working.=20 I guess I'm missing something but ..... What? Some ideas or hints, or some places ..where to find more info ? I've been digging in the GDB-manual and mailing list for some time now... :-( :-(=20 I'll try to give a small resume of what I'm trying to do. *HOST : PC (ubuntu 9.04) *TARGET : ARM (at91sam9g20) *Buildsystem: buildroot 06/2009 - uclibc-0.9.30.1, gdb 6.8,gcc-4.3.3 *Striping : TURNED OFF. (for all files, this also means libs) *Test-Application : a simpe applciation that uses PTHREAD's!!=20 *GDB: GDB / Gdbserver 6.8 for ARM (all is built for arm-linux-uclibc- ) When the application is run in 'remote-'gdb the application 'HANGS' as soon as the second thread is created. (target : gdbserver *:9000 ./threading) (host : gdb - over TCP/IP -> target ip-address port 9000) >>> target console log <<< # gdbserver *:9000 ./threading=20 Process ./threading created; pid =3D 905 Listening on port 9000 Remote debugging from host 150.158.205.4 Creating thread 0 0: Hello World! 0=20 Creating thread 1 0: Hello World! 1 =20 --->> and now .. the target is 'HANGING' <<--------- >> a normal run on the target ARM -- gives me the expected output << When the Test-application runs STAND-ALONE on the target (normal behavoir... As expected ;-)) ./threading=20 Creating thread 0 0: Hello World! 0=20 Creating thread 1 1: Hello World! 0=20 Creating thread 2 2: Hello World! 0=20 Creating thread 3 3: Hello World! 0=20 Creating thread 4 4: Hello World! 0=20 Sleeping/printing in main .....=20 printing in main 0=20 0: Hello World! 1=20 1: Hello World! 1=20 2: Hello World! 1=20 << some things.. Are removed here >> Hello World! 19=20 4: Hello World! 19=20 printing in main 19=20 printing in main 20=20 printing in main 21=20 printing in main 22=20 printing in main 23=20 printing in main 24=20 printing in main 25=20 printing in main 26=20 printing in main 27=20 printing in main 28=20 printing in main 29=20 Sleeping in main ..... DONE ..=20 What I do not understand is the following: Most people (that have responded, again THANKS for all responses, and sorry I'll keep on bothering you all, but I'm just trying to get my DEBUGGING problem solved..) point me to the fact that my libs (especially libthread_db) would be a wrong version.. But here it comes ... I can't see/understand why I would need libthread_db .. I'm using pthreads ! In fact the only thing I try (at this time) is to step in the 'main' of the program, even not in a 'p'thread. << please have a look at this GDB-CONSOLE-LOG >> /buildhome/20090601/buildroot/toolchain_build_arm/gdbhost-6.8/gdb$ ./gdb GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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=3Di386-pc-linux-gnu --target=3Darm-linux-uclibc". Setting up the environment for debugging gdb. Setting up the environment for debugging gdb - DONE . Breakpoint 1 at 0x8784: file sources/main.c, line 46. (NOEL2-gdb) run Starting program: /tmp/threading=20 [New Thread 906] [Switching to Thread 906] Stopped due to shared library event (NOEL2-gdb) c Continuing. Stopped due to shared library event (NOEL2-gdb) info shared li =46rom To Syms Read Shared Object Library 0x40000930 0x40003eb0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l d-uClibc.so.0 0x40011cc0 0x4001820c Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibpthread.so.0 0x40029ca0 0x40030ec4 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibgcc_s.so.1 0x40044c90 0x400855b0 Yes /buildhome/20090601/buildroot/project_build_arm/at91sam9g20ek/root/lib/l ibc.so.0 (NOEL2-gdb) info breakpoints=20 Num Type Disp Enb Address What 1 breakpoint keep y 0x00008784 in main at sources/main.c:46 (NOEL2-gdb) l 37 } 38 pthread_exit(NULL); 39 } 40=09 41 int main() 42 { 43 pthread_t threads[NUM_THREADS]; 44 int rc, t; 45 for(t=3D0;t> I would expect the GDB-debugger to stop at main.c:48 (the break point is still there ...) but it doesn't. (and the programs HANGS forever)! The Target Console output I get is : Remote debugging from host 150.158.205.4 Process /tmp/threading created; pid =3D 906 Creating thread 0 0: Hello World! 0=20 Creating thread 1 0: Hello World! 1=20 << HANGING >> Kind regards, Noel. =20 -----Original Message----- From: Daniel Jacobowitz [mailto:drow@false.org]=20 Sent: 2Jun09 21:34 To: Paul Pluzhnikov Cc: Vellemans, Noel; gdb@sourceware.org Subject: Re: Q: GDB - Threads On Tue, Jun 02, 2009 at 11:34:40AM -0700, Paul Pluzhnikov wrote: > On Tue, Jun 2, 2009 at 11:17 AM, Daniel Jacobowitz wrote: >=20 > > GDB never uses libthread_db on the host if it is debugging a remote=20 > > target. >=20 > Oops. Sorry, my mistake. >=20 > I guess then OP needs to verify that GDB is loading symbols from=20 > expected libpthread ("set verbose on" should show that), and that=20 > gdbserver on target is loading expected libthread_db ("ldd gdbserver"=20 > on target should show that). Right. I don't remember if gdbserver's debug output helps with this or not. -- Daniel Jacobowitz CodeSourcery