From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4063 invoked by alias); 18 Nov 2005 16:49:50 -0000 Received: (qmail 4055 invoked by uid 22791); 18 Nov 2005 16:49:46 -0000 Received: from trump.cadenux-support.com (HELO cadenux.com) (66.135.34.142) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 18 Nov 2005 16:49:46 +0000 Received: from Sidney (unknown [200.91.139.154]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by cadenux.com (Postfix) with ESMTP id 852DA3A0443; Fri, 18 Nov 2005 20:02:46 +0000 (UTC) Subject: Re: gdb debugging threads help From: Teresa Rivas Reply-To: teresa.rivas@cadenux.com To: Daniel Jacobowitz Cc: gdb@sources.redhat.com In-Reply-To: <20051118152848.GC9100@nevyn.them.org> References: <1132274170.32154.20.camel@localhost.localdomain> <20051118023628.GA31581@nevyn.them.org> <1132324238.32154.30.camel@localhost.localdomain> <20051118152848.GC9100@nevyn.them.org> Content-Type: text/plain Date: Fri, 18 Nov 2005 16:49:00 -0000 Message-Id: <1132332545.32154.42.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00392.txt.bz2 HI, On Fri, 2005-11-18 at 10:28 -0500, Daniel Jacobowitz wrote: > On Fri, Nov 18, 2005 at 08:30:37AM -0600, Teresa Rivas wrote: > > Which command can I use to see if it is linked against the correct > > thread_db library?? I use a nm -D gdbserver but all I see are the > > symbols from the dynamic libraries not the libraries. > > "ldd" on your target. I don't have ldd on my target so Im gonna trust in the nm -D an also in the information from the /prco/PID/maps of the gdbserver when running which says this: on the target: # gdbserver :5234 simple Process simple created; pid = 58 Listening on port 5234 from a telnet window to the target: # ps PID Uid VmSize Stat Command 1 root 308 S init 2 root SWN [ksoftirqd/0] 3 root SW< [events/0] 4 root SW< [kblockd/0] 5 root SW< [pdflush] 6 root SW< [pdflush] 8 root SW< [aio/0] 7 root SW [kswapd0] 9 root SW [rpciod] 35 root 284 S /usr/sbin/inetd /etc/inetd.conf 45 root 408 S -sh 46 root 324 S gdbserver :5234 simple 47 root 16 T simple 48 root 352 S /usr/sbin/telnetd 49 user 344 S -sh 50 root 408 S sh 51 root 308 R ps # cat /proc/46/maps 00008000-00017000 r-xp 00000000 00:08 3096786 /usr/bin/gdbserver 0001e000-00020000 rw-p 0000e000 00:08 3096786 /usr/bin/gdbserver 00020000-00022000 rwxp 00000000 00:00 0 40000000-40005000 r-xp 00000000 00:08 73959 /lib/ld-uClibc-0.9.26.so 40005000-40006000 rw-p 00000000 00:00 0 4000c000-4000d000 rw-p 00004000 00:08 73959 /lib/ld-uClibc-0.9.26.so 4000d000-40010000 r-xp 00000000 00:08 74075 /lib/libthread_db-0.9.26.so 40010000-40017000 ---p 00003000 00:00 0 40017000-40019000 rw-p 00002000 00:08 74075 /lib/libthread_db-0.9.26.so 40019000-4005f000 r-xp 00000000 00:08 73962 /lib/libuClibc-0.9.26.so 4005f000-40066000 ---p 00046000 00:00 0 40066000-40069000 rw-p 00045000 00:08 73962 /lib/libuClibc-0.9.26.so 40069000-40072000 rw-p 00000000 00:00 0 beffe000-bf000000 rwxp fffff000 00:00 0 I can see it is mapping /lib/libthread_db-0.9.26.so so I guess is linked correctly against it. now I use this on the host and I am able to see debug the threads :) (gdb) set solib-absolute-prefix /target/arm-linux (gdb) file simple Load new symbol table from "/home/trivas/dm320-appro/fs/examples/threads/simple"? (y or n) y Reading symbols from /home/trivas/dm320-appro/fs/examples/threads/simple...done. (gdb) target remote 192.168.200.199:5234 Remote debugging using 192.168.200.199:5234 0x40000c60 in ?? () (gdb) b 87 Breakpoint 1 at 0x8834: file simple.c, line 87. (gdb) b 122 Breakpoint 2 at 0x8a68: file simple.c, line 122. (gdb) c Continuing. [New Thread 1024] [Switching to Thread 1024] Breakpoint 1, main (argc=1, argv=0xbefffed4) at simple.c:90 90 for (i=0; i<60000; i++) { (gdb) info threads 4 Thread 2051 0x4004a678 in sched_yield () from /target/arm-linux/lib/libc.so.0 3 Thread 1026 0x4004a678 in sched_yield () from /target/arm-linux/lib/libc.so.0 2 Thread 2049 0x4004a8ac in poll () from /target/arm-linux/lib/libc.so.0 * 1 Thread 1024 main (argc=1, argv=0xbefffed4) at simple.c:90 thanks a lot for your help ;) -- Teresa R. Rivas teresa.rivas@cadenux.com Cadenux, LLC