gdb移植(交叉版本)

Gdb下载地址:

http://ftp.gnu.org/gnu/gdb/

termcap下载地址:
http://ftp.gnu.org/gnu/termcap/
tar -zxvf termcap-1.3.1.tar.gz


1.编译termcap-1.3.1
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) 在gdb-7.6\gdb下可以找到gdb可执行程序,在gdb-7.6\gdb\gdbserver下可以找到gdbserver可执行程序,
将该gdb命令命名为arm-linux-gdb gdbserver命名为arm-linux-gdbserver

3、gdb交叉版本使用
设备IP:192.168.1.110
PCIP:192.168.1.5
a)设备端
./arm-linux-gdbserver  192.168.1.110:1234 hello
b)PC电脑端
arm-linux-gdb hello
c)进入gdb后远程到设备
target remote 192.168.1.110:1234
d)连接成功后
PC端提示:
 Remote debugging using 192.168.1.110:1234
 Malformed packet(b) (missing colon): ore:0;
 Packet: 'T050b:00000000;0d:30edf4be;0f:b0f70040;thread:3cb;core:0;'
设备端提示:
 Remote debugging from host 192.168.1.5
 readchar: Got EOF
 Remote side has terminated connection.  GDBserver will reopen the connection.
 Listening on port 1234

交叉版本GDB : arm-linux-gdbserver在设备端运行,gdb在PC端运行,arm-linux-gdbserver文件比较小,所以占用设备内存空间小
而本地版本GDB :  arm-linux-gdb在设备端运行文件较大

转载于:https://www.cnblogs.com/baiduboy/p/7616606.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值