From: "Jason Machacek" <jmachacek@stratos.com>
To: "Paul Pluzhnikov" <ppluzhnikov@google.com>
Cc: <gdb@sourceware.org>
Subject: RE: Cross-platform, multithreaded debugging (x86 to ARM) with gdb and gdbserver not recognizing threads
Date: Thu, 17 Dec 2009 18:01:00 -0000 [thread overview]
Message-ID: <597A11B8CF75534EBE76656E186BF106E013E6@stella.stratos.local> (raw)
In-Reply-To: <8ac60eac0912162044k34bc2765ja16c74274141275a@mail.gmail.com>
Hi Paul,
Thanks for the reply.
> A couple of questions:
> - Does gdbserver config.log mention libthread_db.so, and if so, which
one?
$ cat config.log | grep libthread_db -A8
configure:3888: checking for libthread_db
configure:3919:
/opt/crosstool/gcc-3.4.4-glibc-2.3.2/arm-linux/bin/arm-linux-gcc -o
conftest -g -O2 conftest.c -lthread_db >&5
configure:3925: $? = 0
configure:3929: test -z
|| test ! -s conftest.err
configure:3932: $? = 0
configure:3935: test -s conftest
configure:3938: $? = 0
configure:4014: result: -lthread_db
It appears gdbserver with the correct libthread_db--my toolchain is
mentioned, so I'm assuming it's linking the correct library. It's the
only ARM-compatible libthread_db.so on my system.
> - Does ldd gdbserver on target show libthread_db.so, and if so, is the
> right one? (Should come from the same compilation from which libc.so.6
> and libpthread.so.0 came.)
I unfortunately don't have ldd on my target, but gdbserver's maps file
shows that it's grabbing libthread_db.so. I installed that version of
libthread_db.so myself from the toolchain along with libpthread.so, and
libc.so.6 is statically linked into my application.
$ cat /proc/212/maps
00008000-00016000 r-xp 00000000 1f:01 549 /root/gdbserver
0001e000-0001f000 rw-p 0000e000 1f:01 549 /root/gdbserver
0001f000-00042000 rwxp 00000000 00:00 0
2aaab000-2aac0000 r-xp 00000000 1f:01 607 /lib/ld-2.3.2.so
2aac0000-2aac1000 rw-p 00000000 00:00 0
2aac7000-2aac8000 rw-p 00014000 1f:01 607 /lib/ld-2.3.2.so
2aac8000-2aacc000 r-xp 00000000 1f:01 799
/lib/libthread_db-1.0.so
2aacc000-2aad0000 ---p 00004000 1f:01 799
/lib/libthread_db-1.0.so
2aad0000-2aad4000 rw-p 00000000 1f:01 799
/lib/libthread_db-1.0.so
2aad4000-2abec000 r-xp 00000000 1f:01 687 /lib/libc-2.3.2.so
2abec000-2abf6000 rw-p 00110000 1f:01 687 /lib/libc-2.3.2.so
2abf6000-2abf9000 rw-p 00000000 00:00 0
7fffd000-80000000 rwxp ffffe000 00:00 0
> - Is libpthread.so.0 on target stripped?
It doesn't appear to be. I made a copy of libthread_db-1.0.so and ran
'strip' on it, and the file size dropped. Is this the correct approach?
$ cp
/opt/crosstool/gcc-3.4.4-glibc-2.3.2/arm-linux/arm-linux/lib/libthread_d
b-1.0.so .
$ ls -l libthread_db-1.0.so
-rwxr-xr-x 1 jason jason 29579 2009-12-17 09:49 libthread_db-1.0.so
$ /opt/crosstool/gcc-3.4.4-glibc-2.3.2/arm-linux/bin/arm-linux-strip
libthread_db-1.0.so
$ ls -l libthread_db-1.0.so
-rwxr-xr-x 1 jason jason 18296 2009-12-17 09:50 libthread_db-1.0.so
I tried just stripping debugging information as well, and that also
decreased the file size:
$ ls -l libthread_db-1.0.so
-rwxr-xr-x 1 jason jason 29579 2009-12-17 09:53 libthread_db-1.0.so
$ /opt/crosstool/gcc-3.4.4-glibc-2.3.2/arm-linux/bin/arm-linux-strip
--strip-debug libthread_db-1.0.so
$ ls -l libthread_db-1.0.so
-rwxr-xr-x 1 jason jason 23781 2009-12-17 09:54 libthread_db-1.0.so
Does this indicate that I've got a library version mismatch somewhere in
my system? I'm using a toolchain from my SBC supplier, but perhaps that
wasn't the toolchain they used to build all the libraries included on
the target.
Is there any problem with setting up a second set of libraries on my
system? E.g. /lib2 that contains the libraries copied from my
toolchain. Would I have to make changes to my toolchain's directory
structure to ensure the directories matched up with those on the target
(for GDB that is)?
Thanks,
Jason
next prev parent reply other threads:[~2009-12-17 18:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 23:01 Jason Machacek
2009-12-17 4:44 ` Paul Pluzhnikov
2009-12-17 18:01 ` Jason Machacek [this message]
2009-12-17 18:21 ` Paul Pluzhnikov
2009-12-17 18:38 ` Jason Machacek
2009-12-17 18:53 ` Paul Pluzhnikov
2009-12-17 19:04 ` Jason Machacek
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=597A11B8CF75534EBE76656E186BF106E013E6@stella.stratos.local \
--to=jmachacek@stratos.com \
--cc=gdb@sourceware.org \
--cc=ppluzhnikov@google.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