1.远程主机ip 192.168.31.53
2.本地ip(qtcreator5.6版本): 192.168.31.128
步骤
远程主机配置
1.本地 192.168.31.128 编译好debug的 helloworld.exe 放到远程主机上192.168.31.53。拷贝必须的*d.dll,保证可以运行
可以使用 D:\soft\Qt5.6.3\5.6.3\mingw49_32\bin\windeployqt.exe打包
2.把 D:\soft\Qt5.6.3\Tools\mingw492_32\bin\gdbserver.exe 拷贝到远程主机192.168.31.53 同 hellowrold.exe一个目录
3.启动命令 gdbserver 192.168.31.53:2345 helloworld.exe 此处2345是端口,下面用到
3.本地设置下环境
qtcreator->工具->选项-》调试器-》GDB->额外的启动命令 输入如下的参数,自己对着自己的电脑来
set solib-search-path D:\soft\Qt5.6.3\5.6.3\mingw49_32\bin;D:\soft\Qt5.6.3\Tools\mingw492_32\bin;;C:\Windows\syswow64
4.调试->开始调试-》Attach to running debug server ..
服务器端口: 2345 (上一步中的端口)
override server address: 192.168.31.53 (上面的主机ip)
本地执行文档: E:\xxx\debug\helloworld.exe
工作目录:E:\xxx\debug
点击ok就可以远程调试了
调试成功 远程日志会输出 Remote debugging from host 192.168.31.128