From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31823 invoked by alias); 11 Jun 2013 09:03:49 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 31786 invoked by uid 89); 11 Jun 2013 09:03:45 -0000 X-Spam-SWARE-Status: No, score=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_DB autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 11 Jun 2013 09:03:44 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5B93gEY019437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Jun 2013 05:03:42 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5B93fc8022209; Tue, 11 Jun 2013 05:03:41 -0400 Message-ID: <51B6E7EC.7080509@redhat.com> Date: Tue, 11 Jun 2013 09:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Francisco Cuesta CC: gdb@sourceware.org Subject: Re: Cross-compilation shows>error: no termcap library found, why? References: <51B0B2E1.2030800@redhat.com> <51B1B3BC.7020105@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00030.txt.bz2 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