This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Cross debugger
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Chris Sutcliffe <ir0nh34d at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 15 Jun 2011 19:53:42 -0700
- Subject: Re: Cross debugger
- References: <BANLkTikzf18uc-yO4ehRBxPPyNqYnDFnRQ@mail.gmail.com>
> I'm trying to debug a binary I made using the x86_64-w64-mingw32 cross
> compiler toolchain hosted on Cygwin. To that end I've attempted to
> create an x86_64-w64-mingw32 cross debugger by specifying
> '--target=x86_64-w64-mingw32' when configuring gdb 7.2. It worked in
> that a gdb.exe and gdbtui.exe were created (thought there was no
> gdbserver.exe created).
The gdbserver will be automatically built only when host = target,
which is not your case.
What I don't understand is why you created a cross compiler/debugger,
while it seems to me you could have just created a native x64 MinGW
toolset. That's what we do at AdaCore: We use cygwin as the build
environment, but then build a MinGW toolset by configuring with
--build=x86_64-pc-mingw32. As far as I know, the gdbserver will
be automatically built.
And if you can't build a native x64 MinGW compiler (for instance
if you can't find an x86_64-mingw32 compiler), you can still
use your cross compiler to cross-build a native MinGW GDB. Or
you can use that cross compiler to cross-build a native MinGW
GCC, and then use that to build GDB.
> (gdb) start
[...]
> Don't know how to run. Try "help target".
And that's also expected, since you have a cross-debugger. So the
debugger is expecting you to connect to the target where the process
is running.
But the nice thing is that, if I understand your situation correctly,
as soon as you build a native debugger, you will not have to worry
about that anymore.
--
Joel