[英]Eclipse c++ autocomplete does not work, despite finding headers
[英]C/C++ Debugger does not work in VSC despite correct config
如果我尝试使用 C++ 在 Visual Studio Code 上运行调试 session,我会收到此错误。
这是我的配置,我希望调试 session 使用 WSL 在 VSC 终端中启动。
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb", //here :(
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
您需要将 miDebuggerPath 更改为 WSL 环境中安装 gdb 的路径。
因此,您必须将 miDebuggerPath 设置为:
"miDebuggerPath": "/usr/share/gdb",
当你想在 WSL 环境中运行 gd 时。 将其更改为
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
当你想在 Windows 中调试时。
即使您在本地安装了 C/C++ 扩展,也可以在 WSL 远程子系统上安装它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.