This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Trouble cross debugging


Hi all,
I am trying to remotely debug a helloworld program
built using crosstool 

(--host=i686-pc-cygwin
--target=i686-unknown-linux-gnu). However, whenever I
try 

to step though the code. I get an error message like 

"Cannot find bounds of current function"
or 
"Line number out of bounds ..."

However, when I run gdb on the target to debug the
code locally, gdb responds as 

expected.

I built both everything using crosstool including gdb.
eval `cat i686.dat
gcc-3.4.4-glibc-2.3.5-hdrs-2.6.11.2.dat` sh all.sh
--nounpack
 --nobuild --notest --gdb
I am using the standard gdbserver on the target.

Here are some of the details.
When I debug helloworld on the target locally on the
target (helloworld was built on the host and
transferred to the target), it seems to work fine.
Here is some of the output:
$ gdb -v
GNU gdb Red Hat Linux (6.1post-1.20040607.43rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu".

(gdb) info share
>From        To          Syms Read   Shared Object
Library
0x00222b90  0x0028b1a8  Yes        
/usr/lib/libstdc++.so.6
0x00801300  0x0081a644  Yes         /lib/tls/libm.so.6
0x002b350c  0x002b8038  Yes         /lib/libgcc_s.so.1
0x006e0c00  0x007d0cd0  Yes         /lib/tls/libc.so.6
0x006ae7a0  0x006c058f  Yes         /lib/ld-linux.so.2

(gdb) info files
Local exec file:
        `/home/mythtv/HelloWorld/hello.exe', file type
elf32-i386.
        Entry point: 0x80484a0
        0x08048114 - 0x08048127 is .interp
        0x08048128 - 0x08048148 is .note.ABI-tag
        0x08048148 - 0x0804818c is .hash
        0x0804818c - 0x0804824c is .dynsym
        0x0804824c - 0x08048348 is .dynstr
        0x08048348 - 0x08048360 is .gnu.version
        0x08048360 - 0x080483c0 is .gnu.version_r
        0x080483c0 - 0x080483d0 is .rel.dyn
        0x080483d0 - 0x08048408 is .rel.plt
        0x08048408 - 0x0804841f is .init
        0x08048420 - 0x080484a0 is .plt
        0x080484a0 - 0x080486e4 is .text
        0x080486e4 - 0x08048702 is .fini
        0x08048704 - 0x0804872c is .rodata
        0x0804972c - 0x08049738 is .data
        0x08049738 - 0x08049774 is .eh_frame
        0x08049774 - 0x08049854 is .dynamic
        0x08049854 - 0x0804985c is .ctors
        0x0804985c - 0x08049864 is .dtors
        0x08049864 - 0x08049868 is .jcr

(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

When I cross debug helloworld from the host using
gdbserver on the target, I run into problems. I assume
that they are related to finding or interpreting the
proper symbol files, but I really dont know as I
haven't tried this before. Here are the corresponding
details:
$ gdb -v
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "--host=i686-pc-cygwin
--target=i686-unknown-linux-gn
u".
(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

(gdb) info files
        `/home/jshoor/HelloWorld/hello.exe', file type
elf32-i386.
        Entry point: 0x80484a0
        0x08048114 - 0x08048127 is .interp
        0x08048128 - 0x08048148 is .note.ABI-tag
        0x08048148 - 0x0804818c is .hash
        0x0804818c - 0x0804824c is .dynsym
        0x0804824c - 0x08048348 is .dynstr
        0x08048348 - 0x08048360 is .gnu.version
        0x08048360 - 0x080483c0 is .gnu.version_r
        0x080483c0 - 0x080483d0 is .rel.dyn
        0x080483d0 - 0x08048408 is .rel.plt
        0x08048408 - 0x0804841f is .init
        0x08048420 - 0x080484a0 is .plt
        0x080484a0 - 0x080486e4 is .text
        0x080486e4 - 0x08048702 is .fini
        0x08048704 - 0x0804872c is .rodata
        0x0804972c - 0x08049738 is .data
        0x08049738 - 0x08049774 is .eh_frame
        0x08049774 - 0x08049854 is .dynamic
        0x08049854 - 0x0804985c is .ctors
        0x0804985c - 0x08049864 is .dtors
        0x08049864 - 0x08049868 is .jcr
        0x08049868 - 0x08049894 is .got
---Type <return> to continue, or q <return> to quit---

(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/i686-unknown-linux-gnu/i686-unknown
-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/i686-unknown-linux-gnu/i686-unknown
-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 ?? ()
---Type <return> to continue, or q <return> to quit---
#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 you can see I have set the solib-search-path to
/opt/crosstool/gcc-3.4.4-glibc-2.3.5/i686-unknown-linux-gnu/i686-unknown
-linux-gnu/lib/ as Dan suggested in his recipe.

I noticed in the crosstool build output page  that gdb
is supposed to fail in this configuration. Is this why
I am having problems? Is so, is there any way to fix
it, or will gdb never run in this configuration?

Thanks for your help,
J

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]