public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: psmith@gnu.org
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Help with cross-compiling GDB
Date: Tue, 09 Oct 2012 19:30:00 -0000	[thread overview]
Message-ID: <50747B5B.8000605@redhat.com> (raw)
In-Reply-To: <1349726484.10588.12.camel@homebase>

On 10/08/2012 09:01 PM, Paul Smith wrote:
> Hi all.  I'm trying to create a complete toolchain including GCC,
> binutils, plus tools like make, fakeroot, bison, flex, m4, and of course
> GDB.
> 
> What I need to do is have the tools compiled to be able to run on much
> older GNU/Linux distributions, even though my build system is very
> recent.  So I have a cross-compiler built that uses a sysroot from an
> older distribution and I'm using that to compile GDB.  I need to be able
> to compile and debug both 32bit and 64bit programs.  Originally I wanted
> to have a 32bit version of GDB which could debug both, but that doesn't
> appear to be possible.  That's OK, I'm willing to have GDB be a 64bit
> application, or else I'll build GDB twice.  For now I'm just trying to
> get the 64bit GDB working.
> 
> So, I configure GDB with something like this:
> 
>   ./configure --disable-nls --disable-werror --prefix=/tmp/invalid/generic \
>     --host=x86_64-olddist-linux-gnu --target=x86_64-generic-linux-gnu \

with --host != --target, you're configuring a cross debugger.  IOW, the
native debug support isn't included (gdb_native in configure.ac).

> (gdb) run
> Starting program: foo 
> Don't know how to run.  Try "help target".

And this means exactly that -- gdb doesn't know how to "run" with the
current target (none or just the executable), and there's no native target
support to default to.  The suggestion kind of hints at connecting with
"target remote" first, for example.

> This is a 32bit app but I get identical errors (although different show
> arch of course) when I try to debug a 64bit app.  I can set breakpoints,
> etc. but any attempt to run gives the "don't know how to run" error.
> 
> I'm not sure exactly what that means in this context.  It appears to
> have the right architecture and that architecture appears to be
> supported.  So what does GDB need from me?

IIUC, you want to use --build to point at x86_64-olddist-linux-gnu,
not --host.

-- 
Pedro Alves

  reply	other threads:[~2012-10-09 19:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 20:01 Paul Smith
2012-10-09 19:30 ` Pedro Alves [this message]
2012-10-09 20:19   ` Paul Smith

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=50747B5B.8000605@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=psmith@gnu.org \
    /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).