微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

配置 VSCode C++ 调试器以在新的 windows 终端内打开

如何解决配置 VSCode C++ 调试器以在新的 windows 终端内打开

我正在尝试使用 Windows 终端在 VSCode 上设置 C++ 开发。 这是我当前的配置:

{
    "name": "g++.exe - Build and debug active file","type": "cppdbg","request": "launch","program": "${fileDirname}\\${fileBasenameNoExtension}.exe","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": true,"MIMode": "gdb","miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe","setupCommands": [
    {
        "description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true
    }
    ],"prelaunchTask": "C/C++: g++.exe build active file"
}

其中 "externalConsole" 设置为 true"terminal.external.windowsExec" 设置为 "wt"

使用 Ctrl+Shift+C 打开外部终端有效,但是 当我调试我的文件时,它会在 cmd 窗口中打开。

我尝试使用自定义参数"program" 设置为 cmd 以启动 Windows 终端,然后启动 .exe,但这样调试器不会附加到 wt。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。