📄 installation instructions for gdb & gdbserver on arm7tdmi.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML> <HEAD> <TITLE> [uClinux-dev] Installation instructions for gdb & gdbserver on ARM7TDMI </TITLE> <LINK REL="Index" HREF="index.html" > <LINK REL="made" HREF="mailto:uclinux-dev%40uclinux.org?Subject=%5BuClinux-dev%5D%20Installation%20instructions%20for%20gdb%20%26%20gdbserver%20on%20ARM7TDMI&In-Reply-To="> <META NAME="robots" CONTENT="index,nofollow"> <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> <LINK REL="Previous" HREF="011252.html"> <LINK REL="Next" HREF="011201.html"> </HEAD> <BODY BGCOLOR="#ffffff"> <H1>[uClinux-dev] Installation instructions for gdb & gdbserver on ARM7TDMI</H1> <B>Bernhard Kuhn</B> <A HREF="mailto:uclinux-dev%40uclinux.org?Subject=%5BuClinux-dev%5D%20Installation%20instructions%20for%20gdb%20%26%20gdbserver%20on%20ARM7TDMI&In-Reply-To=" TITLE="[uClinux-dev] Installation instructions for gdb & gdbserver on ARM7TDMI">bkuhn at lineo.com </A><BR> <I>Fri Sep 20 17:59:50 EDT 2002</I> <P><UL> <LI>Previous message: <A HREF="011252.html">[uClinux-dev] Strange M5249C3 problem ..</A></li> <LI>Next message: <A HREF="011201.html">[uClinux-dev] question about kernel_thread</A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#11224">[ date ]</a> <a href="thread.html#11224">[ thread ]</a> <a href="subject.html#11224">[ subject ]</a> <a href="author.html#11224">[ author ]</a> </LI> </UL> <HR> <!--beginarticle--><PRE>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: <A HREF="http://www.uclinux.org/~bkuhn/Toolchain/20020920/uClibc-0.9.15-Config.armnommu">http://www.uclinux.org/~bkuhn/Toolchain/20020920/uClibc-0.9.15-Config.armnommu</A> <A HREF="http://www.us.kernel.org/pub/linux/libs/uclibc/uClibc-0.9.15.tar.bz2">http://www.us.kernel.org/pub/linux/libs/uclibc/uClibc-0.9.15.tar.bz2</A> <A HREF="ftp://sources.redhat.com/pub/gdb/releases/gdb-5.2.1.tar.bz2">ftp://sources.redhat.com/pub/gdb/releases/gdb-5.2.1.tar.bz2</A> <A HREF="http://www.uclinux.org/~bkuhn/Toolchain/20020920/patch-gdb-5.2.1-arm7tdmi-20020920">http://www.uclinux.org/~bkuhn/Toolchain/20020920/patch-gdb-5.2.1-arm7tdmi-20020920</A> <A HREF="http://www.uclinux.org/~bkuhn/Toolchain/20020920/patch-uClinux-2.4.17-ptrace">http://www.uclinux.org/~bkuhn/Toolchain/20020920/patch-uClinux-2.4.17-ptrace</A>Now, 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: <A HREF="http://www.uclinux.org/~bkuhn/Toolchain/20020920/arm-elf-gdb.bz2">http://www.uclinux.org/~bkuhn/Toolchain/20020920/arm-elf-gdb.bz2</A> <A HREF="http://www.uclinux.org/~bkuhn/Toolchain/20020920/gdbserver.bz2">http://www.uclinux.org/~bkuhn/Toolchain/20020920/gdbserver.bz2</A>Bernhard 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 <A HREF="http://mailman.uclinux.org/mailman/listinfo/uclinux-dev">uclinux-dev at uclinux.org</A> list server <A HREF="http://www.uClinux.org/">http://www.uClinux.org/</A></PRE><!--endarticle--> <HR> <P><UL> <!--threads--> <LI>Previous message: <A HREF="011252.html">[uClinux-dev] Strange M5249C3 problem ..</A></li> <LI>Next message: <A HREF="011201.html">[uClinux-dev] question about kernel_thread</A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#11224">[ date ]</a> <a href="thread.html#11224">[ thread ]</a> <a href="subject.html#11224">[ subject ]</a> <a href="author.html#11224">[ author ]</a> </LI> </UL><hr><a href="http://mailman.uclinux.org/mailman/listinfo/uclinux-dev">More information about the uClinux-devmailing list</a><br></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -