This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Can't get cross debugging to work
- From: Marc Khouzam <marc dot khouzam at ericsson dot com>
- To: "'gdb at sourceware dot org'" <gdb at sourceware dot org>
- Date: Tue, 13 Mar 2012 15:47:23 -0400
- Subject: Can't get cross debugging to work
Hi,
I've been breaking my head trying to figure out the recipe
to cross debug from a Linux 32bit to a Linux 64bit. Can't do it.
Could someone be kind enough to confirm the steps?
Do I need to 'set architecture'?
Do I need to 'set osabi'?
Target:
> uname -a
Linux toside-linux64 2.6.16.54-0.2.5-smp #1 SMP Mon Jan 21 13:29:51 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux
Compile gdbserver like this:
> cd gdb/build;../configure && make
Run:
> ./gdb/gdbserver/gdbserver :9999 ~/myBin.64
Host:
> uname -a
Linux toside-linux32 2.6.16.60-0.27-smp #1 SMP Mon Jul 28 13:07:19 UTC 2008 i686 i686 i386 GNU/Linux
Compile gdb like this:
> cd gdb/build; ../configure --enable-targets=x86_64-unknown-linux-gnu && make
Run:
> ./gdb/gdb ~/myBin.32
GNU gdb (GDB) 7.4
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /project/lmimtdesign/lmckhou/myBin.32...done.
(gdb) tar remote toside-linux64:9998
Remote debugging using toside-linux64:9998
warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64
warning: Architecture rejected target-supplied description
Remote register badly formatted: T0506:0000000000000000;07:90cbffffff7f0000;10:80baaaaaaa2a0000;thread:66c7;core:0;
here: 00000000;07:90cbffffff7f0000;10:80baaaaaaa2a0000;thread:66c7;core:0;
==
I've tried setting the architecture, I've tried building with --target instead of --enable-targets,
I've tried different names for the target (where are those defined anyway?), I've tried using
--enable-targets=all. Nothing works. Sigh.
Thanks in advance
Marc