之前使用的是Qt4.7後來換成了Qt5.x,Qtcreator的版本使用4.0,使用中發現Qtcreator遠端調試出現“The selected build of GDB does not support Python scripting.It cannot be used in Qt Creator.”
意思是gdb不支援Python腳本不能再Qtcreator中使用。有問題問度娘找了半天終于發現一個能解決問題的分享一下:
sudo apt-get install gdb-multiarch
安裝這個gdb工具。然後Qtcreator中Tools-->Options-->Build & Run 找到Debuggers頁籤添加/usr/bin/gdb-multiarch,對應的Kits中使用的gdb換成添加的這個。
剩下的就是開啟調試了。假設開發闆的IP是192.168.1.123,虛拟機的IP是192.168.1.124。
1.登入到開發闆telnet 192.168.1.123,
2.挂載nfs伺服器 mount -t nfs 192.168.1.124:/nfsshare /mnt/nfs -o nolock,
3.然後gdbserver 192.168.1.124:8888 /mnt/nfs/yourapp -qws 回車,
4.最後Qtcreator中Debug菜單-->Start Debugging-->Attach to Running Debug Server
在彈出的視窗中kit選擇自己配置的嵌入式的,
端口号8888,
Override Server Address:192.168.1.123,
Local executable:可執行檔案在虛拟機中的位置
點選OK就可以正常調試了。