【发布时间】:2021-01-13 03:47:51
【问题描述】:
我在 Windows 10 上并使用 MinGW 在 VS 代码中设置了 C 调试。在launch.json 文件中,如果我设置"externalConsole": true",那么一切都按预期工作,我可以正确调试。但是如果设置为"externalConsole": false",那么集成的VS代码终端会尝试运行:
"cmd /C "c:\Users\16479\.vscode\extensions\ms-vscode.cpptools-1.1.3\debugAdapters\bin\WindowsDebugLauncher.exe --stdin=Microsoft-MIEngine-In-iphorouu.0fb --stdout=Microsoft-MIEngine-Out-10cbyjg3.wkd --stderr=Microsoft-MIEngine-Error-pj3ilqfq.afl --pid=Microsoft-MIEngine-Pid-k5ph25ah.bz2 --dbgExe=C:\MinGW\bin\gdb.exe --interpreter=mi "
然后输出
The system cannot find the path specified.
这是有道理的,因为我从未听说过 cmd 是终端中的东西。但您可以在 Windows 运行工具中运行以打开命令提示符。所以看起来 VS 代码正在尝试运行它用来打开外部终端的相同命令,但它在集成终端中不起作用。
这只是我的理论,我不是专家,但如果有人对此有所了解或有解决方案让我在集成终端中调试,将不胜感激。
【问题讨论】:
标签: c debugging visual-studio-code gdb mingw