注意gdb7.3版本的编译需要gcc4.0以上的版本。


gdb的编译
cd ~/gdb/gdb-7.3.1
mkdir bin
cd bin
../configure --prefix=/opt/gdb-7.3.1 --host=i686-pc-linux-gnu --target=mips-linux
make
make install

gdbserver的编译
cd ~/gdb/gdb-7.3.1/gdb/gdbserver
mkdir bin
cd bin
export CC=/opt/openwrt/kamikaze_7.09/staging_dir_mips/bin/mips-linux-gcc
../configure --target=mips-linux --host=mips-linux
make

注意:gdbserver因为是mips的应用程序,因此需要使用交叉编译工具。我使用的openwrt的编译工具。