gdb移植(设备端本地版本)

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

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

 

目录结构如下:

├── install //新建的安装路径

├── gdb-7.6

├── gdb-7.6.tar.bz2

├── ncurses-5.6

└── ncurses-5.6.tar.gz

解压 tar -zxvf ncurses-5.6.tar.gz

解压 tar -jxvf gdb-7.6.tar.bz2

 

mkdir -m 777 install

1.编译ncurse 5.6

a)./configure --host=arm-linux --prefix=/home/jkf5773/workspace/gdb/gdb-2/install --without-ada --enable-termcap --with-shared

若是其他例如mips平台,则--host=mipsel-linux

b) make

c) make install

2.编译gdb-7.6

a)./configure --host=arm-linux --enable-shared --prefix=/home/jkf5773/workspace/gdb/gdb-2/install --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext LDFLAGS="-L/home/jkf5773/workspace/gdb/gdb-2/install/lib" CPPFLAGS="-I/home/jkf5773/workspace/gdb/gdb-2/install/include"

若是其他例如mips平台,则--host=mipsel-linux

b) make

c) make install

d) 在install/bin下可以找到gdb可执行程序,文件比较大,可以strip一下:arm-linux-strip -s gdb    在install/lib下可以找到libncurses.so库文件,复制到设备的/lib目录下,gdb需要这个库文件

件比较大,可以strip一下:arm-linux-strip -s gdb    在install/lib下可以找到libncurses.so库文件,复制到设备的/lib目录下,gdb需要这个库文件

posted @ 2017-09-29 19:55  _小百  阅读(248)  评论(0编辑  收藏  举报