From: Dmytro Bablinyuk <dmytro.bablinyuk@xtra.co.nz>
To: gdb@sources.redhat.com
Subject: How to configure gdb on arm-linux (for CDB89712)
Date: Fri, 07 Feb 2003 10:38:00 -0000 [thread overview]
Message-ID: <3E438D28.2040104@xtra.co.nz> (raw)
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
next reply other threads:[~2003-02-07 10:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-07 10:38 Dmytro Bablinyuk [this message]
2003-02-07 13:27 ` Daniel Jacobowitz
2003-02-08 10:36 ` Erik Andersen
2003-02-08 15:55 ` Daniel Jacobowitz
2003-02-07 22:35 Dmytro Bablinyuk
2003-02-08 1:38 ` Dmytro Bablinyuk
2003-02-10 20:31 ` Daniel Jacobowitz
2003-02-10 23:50 ` Dmytro Bablinyuk
2003-02-10 23:53 ` Daniel Jacobowitz
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=3E438D28.2040104@xtra.co.nz \
--to=dmytro.bablinyuk@xtra.co.nz \
--cc=gdb@sources.redhat.com \
/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