Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Teresa Rivas <teresa.rivas@cadenux.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com
Subject: Re: gdb debugging threads help
Date: Fri, 18 Nov 2005 16:49:00 -0000	[thread overview]
Message-ID: <1132332545.32154.42.camel@localhost.localdomain> (raw)
In-Reply-To: <20051118152848.GC9100@nevyn.them.org>

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


      reply	other threads:[~2005-11-18 16:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18  0:35 Teresa Rivas
2005-11-18  1:19 ` Jim Blandy
2005-11-18  2:36 ` Daniel Jacobowitz
2005-11-18 14:30   ` Teresa Rivas
2005-11-18 14:38     ` Teresa Rivas
2005-11-18 15:28     ` Daniel Jacobowitz
2005-11-18 16:49       ` Teresa Rivas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1132332545.32154.42.camel@localhost.localdomain \
    --to=teresa.rivas@cadenux.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox