This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cross-compilation shows>error: no termcap library found, why?


On 06/07/2013 03:30 PM, Francisco Cuesta wrote:
> Hi Pedro,
> 
> I don't understand, I have the gdb server running in the target, this
> is all arm archietecture. On the other hand I have my pc, which is x86
> architecture, but for debugging in eclipse I have to point to the dbg
> client (on the pc) which is going to connect to the dbg server on the
> target. SO, both gdb client and gdbserver have to be compiled in arm,
> that is correct or I missunderstand something?

GDB and GDBserver are separate programs.  Applying the terms quoted
below (build/host/target), you get:

For GDB:
You need a GDB that _runs_ on x86.  You use --host to specify where
the program runs.  E.g., --host=i686-unknown-linux-gnu.  However, if
the program is meant to be run on the same system you are building
from, then the --host's default will pick the right option for you
automatically.  You need a GDB that understands how to debug ARM programs.
And you specify that with the --target option, like e.g.,
--target=arm-mv5sft-linux-gnueabi.  (If you don't specify --target,
then the build system defaults --target to the same system as
the one you're building on, which would be x86).

For GDBserver:
You need a GDBserver that _runs_ on the ARM machine.  Again, you use --host
to specify where the program runs.  In this case, GDBserver will run on
ARM, so specify --host=arm-mv5sft-linux-gnueabi.  GDBserver is not a "cross"
tool -- it knows how to debug the programs on its own system.  It's no different
from most other programs running on the ARM system, like grep, sed, etc,
so you build it just like all other autoconf programs.

So again, configure GDB with --target=arm-mv5sft-linux-gnueabi.  Run
the toplevel configure for that (src/configure).

Configure GDBserver with --host=arm-mv5sft-linux-gnueabi.
Run GDBserver's configure for that.  (src/gdb/gdbserver/configure).

Better start from scratch than reuse the same build tree.

I recommend building on a separate build directory from the sources.
Like,

Sources in gdb/src/
Build directory for gdb in gdb/build-gdb/
Build directory for gdbserver in gdb/build-gdbserver/

Cd into gdb/build-gdb/, and do '../src/configure ...'
Cd into gdb/build-gdbserver/, and do '../src/gdb/gdbserver/configure ...'

At any time you want to do a build from scratch, you just need
to wipe build directories.

> 
> Thanks in advance,
> 
> Ps: what's more,  I have done what you suggested and if I did that on
> top level directory of gdb I get the error related to termcap... I
> guess in that directory is where I need to crosscompile the gdb
> client, though.

You don't need to cross compile gdb.  That's a red herring.
Try building a gdb for the local system (just configure with no
options) just to make sure you have all the necessary build
dependencies installed, and you most probably will get the same error.
You'll need to sort that out first.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]