From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22362 invoked by alias); 11 Feb 2005 02:12:03 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22224 invoked from network); 11 Feb 2005 02:11:55 -0000 Received: from unknown (HELO web30510.mail.mud.yahoo.com) (68.142.200.123) by sourceware.org with SMTP; 11 Feb 2005 02:11:55 -0000 Received: (qmail 29824 invoked by uid 60001); 11 Feb 2005 02:11:54 -0000 Message-ID: <20050211021154.29822.qmail@web30510.mail.mud.yahoo.com> Received: from [63.194.112.130] by web30510.mail.mud.yahoo.com via HTTP; Thu, 10 Feb 2005 18:11:54 PST Date: Fri, 11 Feb 2005 04:04:00 -0000 From: Tim Harvey Subject: howto build gdb / gdbserver for x86 host with arm-linux target? To: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-02/txt/msg00072.txt.bz2 I've got an XScale based board (arm-linux) that I need to do some remote debugging on of a program called 'myApp' (note that this program does run fine on the target, and is not stripped, so its compiled correctly). I'm using an embedded linux distro that builds gdbserver for arm-linux and on my linux FC3 devel system I've got gdb 6.1 installed. I'm doing the following: XScale target: # gdbserver foo:1234 myApp Process myApp created; pid = 165 code at (nil) - (nil), data at (nil) x86 FC3 Linux development host: $ file romfs/bin/myApp romfs/bin/myApp: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped $ gdb romfs/bin/myApp GNU gdb Red Hat Linux (6.1post-1.20040607.43rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) target remote 192.168.1.120:1234 Remote debugging using 192.168.1.120:1234 Couldn't establish connection to remote target Reply contains invalid hex digit 59 on the Target I see: Remote debugging using foo:1234 readchar: Got EOF Remote side has terminated connection. GDBserver will reopen the connection. What could the cause of the 'invalid hex digit 59' problem be? Its been suggested that my gdb/gdbserver are not built correct so I downloaded gdb 6.3 and would like to know how to build them appropriately for my configuration. If I do the following, gdbserver does not get built: $ cd gdb-6.3 $ ./configure --target=arm-linux $ make This builds an x86 exe of gdb, but does not build gdbserver. Is this correct? (host=i686 (autodetected), target=arm-linux). If I do the following to build gdb server, it does not generate arm-linux exe: $ cd gdb/gdbserver $ ./configure --host=arm-linux --target=arm-linux $ make I'm I not understanding host and target? I would think that as I wish to remote debug an app on an arm-linux target, from a x86 host that I would want i686 host and arm-linux target for gdb, and arm-linux host and target for gdbserver. What am I doing wrong? Thanks for any guidance, Tim