1、下载
下载地址:http://ftp.gnu.org/gnu/gdb/
镜像站点:https://mirrors.ustc.edu.cn/gnu/
2、解压并创建目录
tar -zxvf gdb-8.3.tar.gz
mkdir obj_gdb
mkdir obj_gdbserver
touch ./obj_gdb/build
touch ./obj_gdbserver/build
3、前期准备
8.0以后要依赖expat库,不装的话会运行时会出现如下错误:
(gdb) target remote 192.168.0.138:1234
Remote debugging using 192.168.0.138:1234
warning: Can not parse XML target description; XML support was disabled at compile time
Reading /lib/ld-linux-armhf.so.3 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib/ld-linux-armhf.so.3 from remote target...
Reading symbols from target:/lib/ld-linux-armhf.so.3...do