问题:mac机器上使用vscode debug c++,按照网上文章配置后,启动debug会报错:
debug提示如下:
说明是和lldebug没法建立连接。
解决办法:使用xcode的lldb-mi替换。
1)找出本地lldb-mi路径:
2)在launch.json增加miDebuggerPath项
{
"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"
}
]
}