gdbserver + gdb 远程调试 主机安装samba服务后添加用户 目标机mount share dir 目标机上启动程序 主机编译支持arm-linux架构的gdb gdb-arm后带目标程序 运行方式

主机为Linux,如Ubuntu; 目标机为arm-linux,如树莓派。

sudo smbpasswd -a chents

目标机mount share dir

sudo mount //192.168.111.19/chents_share chents_share -t cifs -o user=chents,pass=chenpwd,iocharset=utf8,uid=pi,gid=pi
uid=pi,gid=pi 表示用户及组都是pi(则用户pi可读写)表示用户及组都是pi(则用户pi可读写)
CIFS VFS: No username specified失败的原因 可能是要sudo apt-get install nfs-common

sudo apt-get install nfs-kernel-server
sudo mount -t nfs 192.168.199.101:/home/chen/workspace_robotos_x32 workspace_robotos_x32 -o nolock
文件在主机上,编译要在目标机上

目标机上启动程序

gdbserver :2345 ./t -c <参数>

主机编译支持arm-linux架构的gdb

./configure –host=x86_64-linux –target=arm-linux

gdb-arm后带目标程序

gdb-arm ./t
set architecture i386:x86-64:intel
add-symbol-file linux-3.0/vmlinux
target remote 192.168.110.97:2345
continue
ctrl + c
set solib-search-path .

运行方式

Manual Remote Debugging Launcher #开发版手动运行
Automatic Remote Dubugging Launcher #自动运行