1. 程式人生 > >gdb移植(交叉版本)

gdb移植(交叉版本)

efi 下載地址 sid gettext missing med 本地 flag lan

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在設備端運行文件較大

gdb移植(交叉版本)