问题是vs代码不允许我编译的程序在终端显示输出,并说“没有连接到gdb调试器”。我已经使用vs代码一段时间了,这是第一次发生这种情况。程序成功构建,但调试器不工作。
我已经使用vs代码一段时间了,这是第一次发生。我没有做任何可能导致这样的问题,我对此感到非常困惑。
enter image description here
这是我的launch.json文件
{
"configurations": [
{
"name": "C/C++: g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "E:/my64/mingw64/bin/gdb.exe",
"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
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}],
"version": "2.0.0"
}
字符串
这是我的task.json文件
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "E:/my64/mingw64/bin/g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "E:/my64/mingw64/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
型
(我知道这些问题存在于这里,但他们的解决方案并没有被证明是有益的,所以我需要直接的帮助。
1条答案
按热度按时间7xllpg7q1#
嗯,我重新安装了调试器扩展为C++,它似乎是工作正常了。问题可能是在扩展。它只是崩溃了一些原因,我不知道。