[uClinux-dev] Installation instructions for gdb & gdbserver on ARM7TDMI
Bernhard Kuhn bkuhn at lineo.com
Fri Sep 20 17:59:50 EDT 2002
- Previous message: [uClinux-dev] Strange M5249C3 problem ..
- Next message: [uClinux-dev] question about kernel_thread
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi everybody! It took me quite some time to figure out how to get gdb and gdbserver combiled for an ARM7TDMI based uClinux target. Below, you will find a detailed installation instruction. BTW.: Thanks to Ho Lee for providing usefull hints! I have briefly tested gdb and gdbserver with a simple target program and it seems to work fine (breakpoint setting, single stepping etc.), but as always YMMV :-) Feedback appreciated! best regards Bernhard arm-elf-gdb installation ======================== This document describes how to compile gdb and gdbserver for ARM7TDMI uClinux targets. This desciption was tested on RedHat 6.2 with an Atmel AT75C220-DK but should work with other ARM7TDMI target as well - feedback appreciated! It is assumed that you already have an arm-elf cross-compilation toolchain installed and a recent uClinux-distribution (20010701) running on your target. Installation procedure ---------------------- At the very beginning, you need to define where the kernel sources are located, i.e.: export KERNEL_SOURCE=$HOME/uClinux-dist/linux-2.4.x Then, create some working directories: export GDB_DEVEL_PREFIX=$HOME/arm-elf-gdb export DEVEL_PREFIX=$GDB_DEVEL_PREFIX/usr export PKGDIR=$GDB_DEVEL_PREFIX/packages export SRCDIR=$GDB_DEVEL_PREFIX/src install -d $PKGDIR install -d $SRCDIR Download the following files to $PKGDIR: http://www.uclinux.org/~bkuhn/Toolchain/20020920/uClibc-0.9.15-Config.armnommu http://www.us.kernel.org/pub/linux/libs/uclibc/uClibc-0.9.15.tar.bz2 ftp://sources.redhat.com/pub/gdb/releases/gdb-5.2.1.tar.bz2 http://www.uclinux.org/~bkuhn/Toolchain/20020920/patch-gdb-5.2.1-arm7tdmi-20020920 http://www.uclinux.org/~bkuhn/Toolchain/20020920/patch-uClinux-2.4.17-ptrace Now, you need to patch the kernel sources: cd $KERNEL_SOURCE/arch/armnommu/kernel patch ptrace.c < $PKGDIR/patch-uClinux-2.4.17-ptrace Recompile the kernel and deploy it to your target. Then, build uClibc with libm disabled: cd $SRCDIR tar -xIf $PKGDIR/uClibc-0.9.15.tar.bz2 cd uClibc-0.9.15 cp $PKGDIR/uClibc-0.9.15-Config.armnommu Config make make install Build gdb for arm-elf: cd $SRCDIR tar -xIf $PKGDIR/gdb-5.2.1.tar.bz2 cd gdb-5.2.1 patch -p1 < $PKGDIR/patch-gdb-5.2.1-arm7tdmi-20020920 ./configure --target=arm-elf --host=i386-linux --build=i386-linux make Now, strip gdb/gdb and copy it to a convenient location, i.e. to /usr/local/bin/arm-elf-gdb Build gdbserver for arm-elf: cd $SRCDIR/gdb-5.2.1/gdb/gdbserver chmod u+x configure ./configure --target=arm-linux --host=arm-linux --build=i386-linux mv Makefile Makefile.orig cat Makefile.orig | sed -e "s/CC = gcc/# CC = gcc/" | sed -e "s/CFLAGS = -g -O2/# CFLAGS = -g -O2/" > Makefile mv config.h config.h.orig cat config.h.orig | sed -e "s/#define HAVE_SYS_REG_H 1////* #undef HAVE_SYS_REG_H 1 ///*/" > config.h CC=arm-elf-gcc CFLAGS="-g -Os -nostdinc -I$DEVEL_PREFIX/include -I/opt/uClinux/toolchain-arm-elf/lib/gcc-lib/arm-elf/2.95.3/include -D__linux__ -D__uClinux__ -D__linux__ -D__ELF__ -DNO_MM" XM_CLIBS="-nostdlib -L$DEVEL_PREFIX/lib -nostartfiles $DEVEL_PREFIX/lib/crt0.o $DEVEL_PREFIX/lib/crti.o $DEVEL_PREFIX/lib/crtn.o -lc -lgcc -Wl,-elf2flt" make Admitidly, this line locks ugly but works fine :-) Finaly, deploy the gdbserver binary to your target filesystem. Precomopiled binaries --------------------- If you are not successfull with compiling gdb and gdbserver yourself, you may download some precompiled binaries: http://www.uclinux.org/~bkuhn/Toolchain/20020920/arm-elf-gdb.bz2 http://www.uclinux.org/~bkuhn/Toolchain/20020920/gdbserver.bz2 Bernhard Kuhn, Senior Software Engineer, Embedix Inc. Fri Sep 20 16:42:41 CEST 2002 -- Bernhard Kuhn, Senior Software Engineer, Lineo Inc. (Where Open Meets Smart) This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/
- Previous message: [uClinux-dev] Strange M5249C3 problem ..
- Next message: [uClinux-dev] question about kernel_thread
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]