下载源代码包之后,按步骤执行以下命令
#!bin/sh
tar xzf gdb-7.2.tar.gz
cd gdb-7.2
mkdir -p ../gdb_build
cd ../gdb_build
../gdb-7.2/configure --target=arm-linux --enable-shared --prefix=/home/test/gdb_build/ --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext
make
make install
#server
mkdir -p ../gdbserver_build
cd ../gdbserver_build/
chmod +x ../gdb-7.2/gdb/gdbserver/configure
CC=/cross-tools/arm-linux-uclibcgnueabi-gcc ../gdb-7.2/gdb/gdbserver/configure --host=arm-linux --target=arm-linux --without-included-regex --without-included-gettext
#此处编译gdbserver时如果出现PATH_MAX undeclared错误,在gdb/gdbserver/hostio.c文件中增加,#include ,原因是宏PATH_MAX在中没有定义,而是定义在中
make
#编译完成之后会在gdbserver_build/bin中生成gdbserver
cp -vf gdbreplay gdbserve ../gdb_build/bin
阅读(6572) | 评论(1) | 转发(0) |