This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Trouble remote debugging
- From: EJS <ejshoor at yahoo dot com>
- To: gdb at sourceware dot org
- Date: Fri, 24 Feb 2006 17:30:54 -0800 (PST)
- Subject: Trouble remote debugging
Hi,
I am trying to remote debug a hello world program that
was cross compiled on a cygwin host for a linux target
(using crosstool). The problem that I am having is
that the shared libaries are not being handled
correctly by gdb. Specifically, if run gdb on the
target machine my bt looks like:
(gdb) bt
#0 0x006ae7a2 in _dl_sysinfo_int80 () from
/lib/ld-linux.so.2
#1 0x00784253 in __read_nocancel () from
/lib/tls/libc.so.6
#2 0x00729aa8 in _IO_file_read_internal () from
/lib/tls/libc.so.6
#3 0x0072882e in _IO_new_file_underflow () from
/lib/tls/libc.so.6
#4 0x0072ae0b in _IO_default_uflow_internal () from
/lib/tls/libc.so.6
#5 0x0072abfd in __uflow () from /lib/tls/libc.so.6
#6 0x00725c5f in getc () from /lib/tls/libc.so.6
#7 0x080485ed in main () at hello.cpp:10
Whereas when I try the same bt connected remotely
through gdbserver. I get
(gdb) bt
#0 0x006ae7a2 in ?? ()
#1 0x00784253 in ?? ()
#2 0x007f1ff4 in ?? ()
#3 0x00729aa8 in ?? ()
#4 0x00000000 in ?? ()
#5 0xb7ffe000 in ?? ()
#6 0x00000400 in ?? ()
from /opt/crosstool/gcc-3.4.4-glibc-2.3.5
-linux-gnu/lib/libstdc++.so.6
#7 0xbffff93c in ?? ()
#8 0x0072882e in ?? ()
#9 0x007f2720 in ?? ()
#10 0xb7ffe000 in ?? ()
#11 0x00000400 in ?? ()
from /opt/crosstool/gcc-3.4.4-glibc-2.3.5
-linux-gnu/lib/libstdc++.so.6
#12 0x007f1ff4 in ?? ()
#13 0x007f2720 in ?? ()
#14 0xb7fe76c0 in ?? ()
#15 0xbffff94c in ?? ()
#16 0x0072ae0b in ?? ()
#17 0x007f2720 in ?? ()
#18 0x007f2720 in ?? ()
#19 0xbffff964 in ?? ()
#20 0x0072abfd in ?? ()
#21 0x007f2720 in ?? ()
#22 0xbffffa24 in ?? ()
#23 0x007f1ff4 in ?? ()
#24 0x007f2720 in ?? ()
#25 0xbffff978 in ?? ()
#26 0x00725c5f in ?? ()
#27 0x007f2720 in ?? ()
#28 0xbffffa24 in ?? ()
#29 0xbffff9b0 in ?? ()
#30 0xbffff998 in ?? ()
#31 0x080485ed in main () at hello.cpp:10
As far as I know, I have set my solib-search-path
correctly and my shlibs are being found as you can see
from:
(gdb) info share
>From To Syms Read Shared Object
Library
0x0003b920 0x000a8dc0 Yes
/opt/crosstool/gcc-3.4.4-glibc-2.3.5/i686-un
known-linux-gnu/i686-unknown-linux-gnu/lib/libstdc++.so.6
0x00003680 0x0001ac60 Yes
/opt/crosstool/gcc-3.4.4-glibc-2.3.5/i686-un
known-linux-gnu/i686-unknown-linux-gnu/lib/libm.so.6
0x00001680 0x000065c0 Yes
/opt/crosstool/gcc-3.4.4-glibc-2.3.5/i686-un
known-linux-gnu/i686-unknown-linux-gnu/lib/libgcc_s.so.1
0x000153d0 0x000ebbbc Yes
/opt/crosstool/gcc-3.4.4-glibc-2.3.5/i686-un
known-linux-gnu/i686-unknown-linux-gnu/lib/libc.so.6
0x00000760 0x0000f87f Yes
/opt/crosstool/gcc-3.4.4-glibc-2.3.5/i686-un
known-linux-gnu/i686-unknown-linux-gnu/lib/ld-linux.so.2
One thing that I noticed is that the symbol tables for
the cross compiled shlibs are different than the ones
on the target (I checked this via objdump -T). Is this
the problem? If so how do I make them the same?
Thanks,
J
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com