【发布时间】:2021-12-30 02:26:03
【问题描述】:
如果我尝试使用 C++ 在 Visual Studio Code 上运行调试会话,我会收到 error。
这是我的配置,我希望使用 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
}
]
}
]
}
G++ 和 GDB 都安装了 locally 和 WSL。我尝试将所有这些目录用于“miDebuggerPath”路径;没用。
【问题讨论】:
-
在工作区中的屏幕截图中,我还尝试远程跳转 WSL,但它告诉我无法识别调试类型“cppdbg”并告诉我为其安装扩展。当我点击安装时,它会将我带到以“cppdbg”作为搜索词的扩展列表,但没有找到 imgur.com/a/p9oA487
-
请将错误信息放入问题中,以便下一个可以在这里找到。另外,请尝试搜索它。文本图像通常很糟糕并且不受欢迎。作为这里的新用户,也请带上tour并阅读How to Ask。
标签: c++ c debugging visual-studio-code vscode-debugger