This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb debugging threads help
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