問(wèn)題:mac機(jī)器上使用vscode debug c++照卦,按照網(wǎng)上文章配置后腊脱,啟動(dòng)debug會(huì)報(bào)錯(cuò):
debug提示如下:
說(shuō)明是和lldebug沒(méi)法建立連接。
解決辦法:使用xcode的lldb-mi替換姑丑。
1)找出本地lldb-mi路徑:
2)在launch.json增加miDebuggerPath項(xiàng)
{
"version": "0.2.0",
"configurations": [
{
"name": "c/c++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/test.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"preLaunchTask": "c++",
"logging": { "engineLogging": true },
"miDebuggerPath":"/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi"
}
]
}