gdb移植到嵌入式开发板中
时间:10-02
整理:3721RD
点击:
1. 编译termcap
1)下载源码压缩包
ftp://ftp.gnu.org/gnu/termcap/
2) 编译
./configure --target=arm-linux-gnueabihf
手动修改Makefile 中的CC ,AR等变量,然后make 即可。
PS: 直接 ./configure --target=arm-linux-gnueabihf CC=${COMPILE_PATH}/arm-linux-gnueabihf-gcc,貌似并没有
指定到arm的编译器,不知道为啥,没有仔细研究。
2.编译gdb
1)下载源码压缩包
http://ftp.gnu.org/gnu/gdb/
2) 编译
./configure --host=arm-linux-gnueabihf --enable-shared --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext LDFLAGS=-L/home/liuzhao/termcap-1.3.1/libtermcap.a CC=${COMPILE_PATH}/arm-linux-gnueabihf-gcc
PS: CC指定到自己的编译器
另注意:1)gdb调试多线程时,平台路径/lib/下必须要有libthread_db.so,否则只能调试主线程。
2)libthread_db.so 和 libpthread.so必须要有符号表才可以调试多线程
1)下载源码压缩包
ftp://ftp.gnu.org/gnu/termcap/
2) 编译
./configure --target=arm-linux-gnueabihf
手动修改Makefile 中的CC ,AR等变量,然后make 即可。
PS: 直接 ./configure --target=arm-linux-gnueabihf CC=${COMPILE_PATH}/arm-linux-gnueabihf-gcc,貌似并没有
指定到arm的编译器,不知道为啥,没有仔细研究。
2.编译gdb
1)下载源码压缩包
http://ftp.gnu.org/gnu/gdb/
2) 编译
./configure --host=arm-linux-gnueabihf --enable-shared --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext LDFLAGS=-L/home/liuzhao/termcap-1.3.1/libtermcap.a CC=${COMPILE_PATH}/arm-linux-gnueabihf-gcc
PS: CC指定到自己的编译器
另注意:1)gdb调试多线程时,平台路径/lib/下必须要有libthread_db.so,否则只能调试主线程。
2)libthread_db.so 和 libpthread.so必须要有符号表才可以调试多线程
感谢分享,这个搞定开发很方便。
gdb是什么东西啊?
