【问题标题】:VS Code GDB debugging doesn't work in integrated terminal, but it works in external terminalVS Code GDB 调试在集成终端中不起作用,但在外部终端中起作用
【发布时间】: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


    【解决方案1】:

    为了解决这个问题,我将默认 shell 设置为 Powershell,而不是 VS 代码中的命令提示符。

    【讨论】:

      猜你喜欢
      • 2019-03-19
      • 1970-01-01
      • 2017-04-22
      • 1970-01-01
      • 1970-01-01
      • 2018-02-14
      • 2019-10-05
      • 2019-09-30
      • 2021-11-10
      相关资源
      最近更新 更多