vscode配置gdb调试外部程序
有一个工程是用qtcreator编译的
我现在用vscode远程访问的这个工程,目前只能在vscode界面编辑代码。
编译需要在qtcreator下面。
刚开始也只能在 qtcreator下面 调试(debug,打断点)
目前在vscode里面安装了 gdb工具之后,就可以直接调试 qtcreator 编译好的二进制文件了。而且可以打断点。
下面是launch.json文件里面的配置。注意路径地址。
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "cppdbg", "request": "launch", "name": "gdb1", "program": "${workspaceFolder}/common/bin/x64/Debug/guide_pg_server", "MIMode": "gdb", "cwd": "${workspaceFolder}/common/bin/x64/Debug" }, { "type": "cppdbg", "request": "launch", "name": "gdb2", "program": "${workspaceFolder}/common/bin/x64/Debug/gd_pgclient_unit_d", "MIMode": "gdb", "cwd": "${workspaceFolder}/common/bin/x64/Debug" }, { "type": "cppdbg", "request": "launch", "name": "gdb3", "program": "${workspaceFolder}/common/bin/x64/Debug/guide_pgclient_service", "MIMode": "gdb", "cwd": "${workspaceFolder}/common/bin/x64/Debug" } ] }