我可以通过按 F5 成功调试我的代码,但如果我尝试第二次运行它,它将失败,并在终端输出中显示
No such file or directory
。
这曾经按预期工作,但我最近开始遇到这种情况,所以我想知道它是否与this有关?
我的
launch.json
是基于提供的示例,但作为参考,它是这样的:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/test.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}
]
}
尝试第二次运行后,终端如下所示:请注意第二次,命令的开头似乎已被截断
Alex@Alex_Asus MINGW64 ~/Documents/GameEngine/EngineTest
$ /usr/bin/env c:\\Users\\Alex\\.vscode\\extensions\\ms-vscode.cpptools-1.19.9-win32-x64\\debugAdapters\\bin\\WindowsDebugLauncher.exe --stdin=Microsoft-MIEngine-In-c2axmb5z.gjq --stdout=Microsoft-MIEngine-Out-5qxnf0rp.y1x --stderr=Microsoft-MIEngine-Error-itnz0wk4.tmp --pid=Microsoft-MIEngine-Pid-iod3xchz.rmb --dbgExe=C:\\MinGW\\bin\\gdb.exe --interpreter=mi
Alex@Alex_Asus MINGW64 ~/Documents/GameEngine/EngineTest
$ ^C
Alex@Alex_Asus MINGW64 ~/Documents/GameEngine/EngineTest
$ \\ms-vscode.cpptools-1.19.9-win32-x64\\debugAdapters\\bin\\WindowsDebugLauncher.exe --stdin=Microsoft-MIEngine-In-dob4gqtf.x31 --stdout=Microsoft-MIEngine-Out-r1qtapcf.vwn --stderr=Microsoft-MIEngine-Error-sysmwcem.542 --pid=Microsoft-MIEngine-Pid-s2l523nn.m1i --dbgExe=C:\\MinGW\\bin\\gdb.exe --interpreter=mi
bash: \ms-vscode.cpptools-1.19.9-win32-x64\debugAdapters\bin\WindowsDebugLauncher.exe: No such file or directory
Alex@Alex_Asus MINGW64 ~/Documents/GameEngine/EngineTest
$
关闭集成终端并重试效果很好,但这很烦人。我做错了什么?
我通过卸载并重新安装 vs code 成功解决了这个问题。