在Mac環境下,除錯一個簡單的C++程式,除錯中設定斷點,程式也會直接跑完。而且跑完后,變數、監視都不顯示任何東西。

這是我的launch組態檔
{
// 使用 IntelliSense 了解相關屬性。
// 懸停以查看現有屬性的描述。
// 欲了解更多資訊,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) 啟動",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",// 除錯程式時的作業目錄,此為作業區檔案夾;改成${fileDirname}可變為檔案所在目錄
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
"setupCommands": [
{
"description":"Enable pretty-printing for lldb",
"text":"-enable-pretty-printing",
"ignoreFailures":false,
}
],
}
],
"preLaunchTask": "TASKS"
}
這是我的tasks組態檔
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "TASKS",
"type": "shell",
"command": "clang++", //c++用g++ ,c用gcc?
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.out",
"-g"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
}
]
}
uj5u.com熱心網友回復:
我也是 哭了 你找到解決方法求分享啊!轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/75960.html
標籤:工具平臺和程序庫
