From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27717 invoked by alias); 7 Feb 2003 10:38:25 -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 27689 invoked from network); 7 Feb 2003 10:38:24 -0000 Received: from unknown (HELO mta201-rme.xtra.co.nz) (210.86.15.144) by 172.16.49.205 with SMTP; 7 Feb 2003 10:38:24 -0000 Received: from mta1-rme.xtra.co.nz ([210.86.15.140]) by mta201-rme.xtra.co.nz with ESMTP id <20030207103823.NVPO1191.mta201-rme.xtra.co.nz@mta1-rme.xtra.co.nz> for ; Fri, 7 Feb 2003 23:38:23 +1300 Received: from xtra.co.nz ([210.55.121.184]) by mta1-rme.xtra.co.nz with ESMTP id <20030207103822.NIML15912.mta1-rme.xtra.co.nz@xtra.co.nz> for ; Fri, 7 Feb 2003 23:38:22 +1300 Message-ID: <3E438D28.2040104@xtra.co.nz> Date: Fri, 07 Feb 2003 10:38:00 -0000 From: Dmytro Bablinyuk User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: How to configure gdb on arm-linux (for CDB89712) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00145.txt.bz2 I built arm-linux and put it on the board. Also I built a cross-compiler (using uclibc) I've done everything as described in http://roland.seuhs.com/en/index.php/Development/LiMa/CDB89712 When I came to the point that I need to debug an application I got stuck (hello world perfectly works on target as standalone application but not with gdb). I tried to build a cross-platform gdb and gdbserver. I tried below steps to do this: 1.Unpack gdb $cd $ARM_ROOT/src $tar xzvf ../dl/gdb-5.3.tar.gz Make symbolic link (easier for next steps if you don't have same version) $ln -s gdb-5.3 gdb 2. Build gdb $cd $ARM_ROOT/src/gdb/ $./configure --host=i686-pc-linux-gnu --target=arm-linux $make $strip gdb/gdb Check that we client for Intel platform: [root@sardine gdb]# file gdb/gdb gdb/gdb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped [root@sardine gdb]# $cp gdb/gdb /usr/local/bin/arm-gdb 3. Build gdbserver $cd $ARM_ROOT/src/gdb/gdb/gdbserver/ $chmod u+x configure Remove cache file $rm config.cache $export CC=$ARM_ROOT/arm-linux-uclibc/bin/arm-uclibc-gcc $./configure --target=arm-linux --host=arm-linux --build=i386-linux $make clean $make Check output file [root@sardine gdbserver]# file gdbserver gdbserver: ELF 32-bit LSB executable, ARM, version 1 (ARM), dynamically linked (uses shared libs), not stripped [root@sardine gdbserver]# Copy into the target's ramdisk $cp gdbserver $ARM_ROOT/ramdisk/target/usr/bin/ As result I got a Illegal Instruction message when I started this up. On host: [Dmytro@sardine Dmytro]$ arm-gdb -nw $ARM_ROOT/ramdisk/target/armdevelop/hello GNU gdb 5.2.1 Copyright 2002 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 "--host=i686-pc-linux-gnu --target=arm-linux"... (gdb) target remote 172.25.193.23:1023 Remote debugging using 172.25.193.23:1023 0x00008110 in _start () (gdb) b main Breakpoint 1 at 0x8158: file hello.c, line 4. (gdb) c Continuing. Program received signal SIGILL, Illegal instruction. 0x00008114 in _start () (gdb) On target(CDB89712) # gdbserver 172.25.140.19:1023 /armdevelop/hello Process /armdevelop/hello created; pid = 196 Remote debugging from host 172.25.140.19 hello(135): undefined instruction: pc=00008114 Code: e91ba800 e3a0b000 (e7ffdefe) e1a0100d e0812100 Killing inferior # And then # tail /var/log/messages Jan 1 05:53:56 name user.warn klogd: Code: e91ba800 e3a0b000 (e7ffdefe) e1a0100d e0812100 Jan 1 05:59:15 name syslog.info -- MARK -- Jan 1 06:19:15 name syslog.info -- MARK -- Jan 1 06:39:15 name syslog.info -- MARK -- Jan 1 06:59:15 name syslog.info -- MARK -- Jan 1 07:19:15 name syslog.info -- MARK -- Jan 1 07:20:31 name user.info klogd: hello (183): undefined instruction: pc=00008114 Jan 1 07:20:31 name user.warn klogd: Code: e91ba800 e3a0b000 (e7ffdefe) e1a0100d e0812100 Jan 1 07:22:14 name user.info klogd: hello (185): undefined instruction: pc=00008114 Jan 1 07:22:14 name user.warn klogd: Code: e91ba800 e3a0b000 (e7ffdefe) e1a0100d e0812100 # Thanks in advance for any help, Dmytro