public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Chris Sutcliffe <ir0nh34d@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Cross debugger
Date: Thu, 16 Jun 2011 02:54:00 -0000	[thread overview]
Message-ID: <20110616025342.GS5944@adacore.com> (raw)
In-Reply-To: <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

  reply	other threads:[~2011-06-16  2:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  2:00 Chris Sutcliffe
2011-06-16  2:54 ` Joel Brobecker [this message]
2011-06-16 11:54   ` Chris Sutcliffe
2011-06-16 13:54     ` Paul Koning
2011-06-16 14:19       ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110616025342.GS5944@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=ir0nh34d@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).