arm单板上移植gdb

arm单板上移植gdb

 
在搭建gdb调试环境时,本来以为是件很简单的事,可是出现了,几个错误,很是郁闷,弄了几个小时,现在把我遇到的问题及解决办法列出来,还有整个安装过程,如下:
    在make时遇到的问题:
1、error: no termcap library found
2、error: makeinfo is required for compilation
解决办法:
sudo apt-get install texinfo

 

sudo apt-get install libncurses5-dev

sudo apt-get install m4

sudo apt-get install flex

sudo apt-get install bison

 

虚拟机安装好之后,安装一下基本的工具环境

sudo apt-get update

sudo apt-get install build-essential

 

arm交叉编译工具链: arm-none-linux-gnueabi , 下载地址 http://www.veryarm.com/cross-tools ,选择 2012.09 月的版本

gdb 源码下载地址: http://ftp.gnu.org/gnu/gdb/

我下载了 gdb-7.4.1.tar.bz2 ,解压进入代码目录:

./configure --host=arm-none-linux-gnueabi

 

貌似很正常,开始make

然而过了一会,就会出现 

configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found

 

网上找了很多方法,都不管用

比如安装ncurses库: sudo  apt-get install libncurses5-dev, 装了也没用

 

比如下载 termcap-1.3.1.tar.gz 编译 放入到 工具链的 /lib目录,比如 /home/arm-2012.09/arm-none-linux-gnueabi/lib  也是没用的,于是我仔细的想上面的错误信息,在configure的过程里,应该首先是使用ncurses库,没找到呢,也不会继续找termcap库,所以

 

下载 ncurses-5.5-tar.gz 编译安装如下,这个问题总算解决了。

下载地址: http://ftp.gnu.org/gnu/ncurses/

./configure --host=arm-none-linux-gnueabi --prefix=/home/arm-2012.09/arm-none-linux-gnueabi

make

make install

 

这个时候,再去make gdb就不会出上面的错误了,然而事情并不会那么简单,后面会继续出现新的问题。

In file included from arm-linux-nat.c:25:0:
linux-nat.h:79:18: error: field 'siginfo' has incomplete type
arm-linux-nat.c: In function 'arm_linux_stopped_data_address':
arm-linux-nat.c:1141:23: error: dereferencing pointer to incomplete type
arm-linux-nat.c:1144:16: error: dereferencing pointer to incomplete type
arm-linux-nat.c:1145:20: error: dereferencing pointer to incomplete type
arm-linux-nat.c:1157:46: error: dereferencing pointer to incomplete type

这里应该是源码跟linux系统的头文件匹配不上啦,有人建议修改这个siginfo为siginfo_t这个结构体,但是我觉得没必要去修改了,直接下载了 gdb-7.6.1.tar.gz 编译OK

编译命令:

./configure --host=arm-none-linux-gnueabi

make

make install

 

然后在源码的gdb目录就可以看到gdb可执行文件:

dancy@dancy:~/downloads/gdb-7.6.1/gdb$ file gdb
gdb: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

原文链接: https://www.cnblogs.com/alix-1988/p/12707347.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    arm单板上移植gdb

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/400965

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年4月17日 上午9:34
下一篇 2023年4月17日 上午9:34

相关推荐