之前使用的是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就可以正常調試了。