ubuntu12.04 安装 arm-linux-gdb

参考大神kangear的文章(链接在此:http://blog.csdn.net/kangear/article/details/8635029)

下载gdb的源代码,我下载的是gdb-7.6.2版本的。

复制压缩包到/tmp下,tar -xzvf gdb-7.6.2.tar.gz ; mv gdb-7.6.2 /usr/local/ (可能显得有点多余,直接将压缩包复制到/usr/local可能好点)

转到/usr/local/gdb-7.6.2/下, 执行:

./configure --target=arm-linux --prefix=/usr/local/bin/arm-gdb -v

make

make后报错:

configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/var/lib/gforge/chroot/home/users/mirror/tmp/gdb-7.5'
make: *** [all] Error 2

提示找不到termcap库。上网搜了一下,感觉安装termcap库挺麻烦,于是安装了libncurses5-dev

sudo apt-get install libncurses5-dev

安装完成后 make clean; make

好了,没有报错。再:

make install

ok!

其他的按大神的帖子做吧!

root@liveman-desktop:/usr/local/bin/gdb-arm/bin# ./arm-linux-gdb
GNU gdb (GDB) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-linux".
For bug reporting instructions, please see:
.
(gdb)

看起来没有问题了,其他的还没试。

PS:在将arm-linux-gdb的路径到环境变量PATH中时,/usr/local/bin/arm-linux-gdb不能识别arm-linux-gdb,换到/opt/arm-linux-gdb下便好了,具体原因不清楚。

你可能感兴趣的:(嵌入式)