【发布时间】:2019-05-29 15:14:45
【问题描述】:
我想在 vscode 中启动 gdb。我想在 vscode 中使用 gdb 调试我的 c 代码,但出现以下错误:
无法从命令环境 cd 开始调试意外的 gdb 输出 我在 wsl 上安装了我的 gdb。
这是我的 lauch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\bin\\main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\\windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/z": "z:\\"
}
}
]
}
我无法调试我的程序
【问题讨论】:
标签: visual-studio-code gdb windows-subsystem-for-linux