* Cross-compiling GDB/GDBSERVER
@ 2007-01-16 8:15 Itzhak Ben-Akiva
2007-01-16 16:51 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Itzhak Ben-Akiva @ 2007-01-16 8:15 UTC (permalink / raw)
To: gdb
Hi all,
I'm having some problems with a cross-compiled gdb/gdbserver. I have
searched the Net to find some help, but nothing that I have not
already tried. Include some mails exchange between Daniel Jacobowitz
and Dan Kegel.
The facts are as follows:
I built my toolchain for PowerPC 440EP with Kegel's crosstool. The
toolchain works properly. I'm using it for one year already.
Two days ago I compiled gdb/gdbserver in the following way:
cd gdb-6.6
./configure –target=powerpc-linux –enable-sim-powerpc \
–prefix=path/to/the/installation/of/toolchain
make
make install
Compilation went smoothly. Then, I compiled gdbserver:
cd ./gdb/gdbserver
./configure –host=powerpc-linux –prefix=path/to/the/installation/of/toolchain
make
make install
Compilation went smoothly without any warnings.
However, when I try to connect to the gdbserver, I get the message I
post below. gdb is trying to find the libraries in the wrong places
instead of the right one, i.e., the toolchain build directory. What am
I missing in the compilation? Should I set CFLAGS and LD_FLAGS to the
path of the toolchain build directory?
Many thanks in advance,
Itzhak
(gdb) target remote 172.20.2.156:9898
Remote debugging using 172.20.2.156:9898
warning: Remote failure reply: E01
0x30010308 in ?? ()
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) b main
Breakpoint 1 at 0x1000378c
(gdb) c
Continuing.
warning: .dynamic section for "/lib/libpthread.so.0" is not at the
expected address
warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
warning: .dynamic section for "/lib/libm.so.6" is not at the expected address
Error while mapping shared library sections:
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/libstdc++.so.6: No such
file or directory.
Error while mapping shared library sections:
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/libgcc_s.so.1: No such
file or directory.
Error while mapping shared library sections:
/lib/ld.so.1: No such file or directory.
Error while reading shared library symbols:
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/libstdc++.so.6: No such
file or directory.
Error while reading shared library symbols:
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/libgcc_s.so.1: No such
file or directory.
Error while reading shared library symbols:
/lib/ld.so.1: No such file or directory.
Program received signal SIGSEGV, Segmentation fault.
0x10001a70 in _start ()
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Cross-compiling GDB/GDBSERVER
2007-01-16 8:15 Cross-compiling GDB/GDBSERVER Itzhak Ben-Akiva
@ 2007-01-16 16:51 ` Daniel Jacobowitz
2007-01-16 19:21 ` Itzhak Ben-Akiva
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-01-16 16:51 UTC (permalink / raw)
To: Itzhak Ben-Akiva; +Cc: gdb
On Tue, Jan 16, 2007 at 10:15:27AM +0200, Itzhak Ben-Akiva wrote:
> However, when I try to connect to the gdbserver, I get the message I
> post below. gdb is trying to find the libraries in the wrong places
> instead of the right one, i.e., the toolchain build directory. What am
> I missing in the compilation? Should I set CFLAGS and LD_FLAGS to the
> path of the toolchain build directory?
You need to either use --with-sysroot when building gdb, set
solib-absolute-prefix, or "set sysroot" if you're using GDB HEAD.
I added a section about this common pitfall to the manual a few weeks
ago.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Cross-compiling GDB/GDBSERVER
2007-01-16 16:51 ` Daniel Jacobowitz
@ 2007-01-16 19:21 ` Itzhak Ben-Akiva
0 siblings, 0 replies; 3+ messages in thread
From: Itzhak Ben-Akiva @ 2007-01-16 19:21 UTC (permalink / raw)
To: Daniel Jacobowitz, gdb
Hi Daniel,
Thanks, I have already solved this problem.
On 1/16/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Tue, Jan 16, 2007 at 10:15:27AM +0200, Itzhak Ben-Akiva wrote:
> > However, when I try to connect to the gdbserver, I get the message I
> > post below. gdb is trying to find the libraries in the wrong places
> > instead of the right one, i.e., the toolchain build directory. What am
> > I missing in the compilation? Should I set CFLAGS and LD_FLAGS to the
> > path of the toolchain build directory?
>
> You need to either use --with-sysroot when building gdb, set
> solib-absolute-prefix, or "set sysroot" if you're using GDB HEAD.
That's exactly what I did. I found on the Net Dan Kegel's "how to"
http://www.kegel.com/linux/gdbserver.txt. It helped me a lot.
Thanks,
Itzhak
P.S.: I'm studying GDB Internals and the mails and patches regarding
to Reverse Debugging Project. I haven't forgot it.
> I added a section about this common pitfall to the manual a few weeks
> ago.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-16 19:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 8:15 Cross-compiling GDB/GDBSERVER Itzhak Ben-Akiva
2007-01-16 16:51 ` Daniel Jacobowitz
2007-01-16 19:21 ` Itzhak Ben-Akiva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox