Installation instructions for gdb & gdbserver on ARM7TDMI

来源:互联网 发布:solaris和linux 编辑:程序博客网 时间:2024/05/18 03:42

[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 gdbservercombiled for an ARM7TDMI based uClinux target. Below, you will finda detailed installation instruction. BTW.: Thanks to Ho Lee forprovidingusefull hints!I have briefly tested gdb and gdbserver with a simple target programand it seems to work fine (breakpoint setting, single stepping etc.),but as always YMMV :-) Feedback appreciated!best regardsBernhardarm-elf-gdb installation========================This document describes how to compile gdb and gdbserverfor ARM7TDMI uClinux targets. This desciption was testedon RedHat 6.2 with an Atmel AT75C220-DK but should workwith other ARM7TDMI target as well - feedback appreciated!It is assumed that you already have an arm-elf cross-compilationtoolchain installed and a recent uClinux-distribution (20010701)running on your target.Installation procedure----------------------At the very beginning, you need to define where the kernelsources are located, i.e.:  export KERNEL_SOURCE=$HOME/uClinux-dist/linux-2.4.xThen, 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 $SRCDIRDownload 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-ptraceNow, you need to patch the kernel sources:  cd $KERNEL_SOURCE/arch/armnommu/kernel  patch ptrace.c < $PKGDIR/patch-uClinux-2.4.17-ptraceRecompile 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 installBuild 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  makeNow, strip gdb/gdb and copy it to a convenient location, i.e. to/usr/local/bin/arm-elf-gdbBuild 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////* #undefHAVE_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" makeAdmitidly, 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 gdbserveryourself, 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.bz2Bernhard Kuhn, Senior Software Engineer, Embedix Inc.Fri Sep 20 16:42:41 CEST 2002-- Bernhard Kuhn, Senior Software Engineer, Lineo Inc. (Where Open MeetsSmart)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 ]

More information about the uClinux-dev mailing list

原创粉丝点击