VSCODEによるデバッグ環境の構築
code:lounch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
{
// 名前。任意
"name": "Launch",
// golangの場合はこれ固定
"type": "go",
// 起動する場合はこれ固定
"request": "launch",
// デバッグモード
"mode": "debug",
// ポート番号自動でdelveを立ち上げてくれる
"port": 2345,
// IPアドレス。そのままだと楽
"host": "127.0.0.1",
// 開いているフォルダのmain関数をデバッグ
"program": "${workspaceFolder}",
// ログ表示
"showLog": true
},
]
}
エラーが出た
code: error
could not launch process: debugserver or lldb-server not found: install XCode's command line tools or lldb-server
lldb-serverが入っているが読み込めないっぽい
code: bash
ln -s /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/lldb-server /usr/local/bin/lldb-server
エラーが出た
code:error
could not launch process: stub exited while attempting to connect: signal: illegal instruction
ツールが足りてないっぽい。これを実行する
code: bash
xcode-select --install