8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

M1 Mac(Apple silicon Mac)のVSCodeでC++のデバッグが出来なかった時のメモ

Last updated at Posted at 2021-08-25

怒られた

Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (attach failed ((os/kern) invalid argument))

スクリーンショット 2021-08-25 15.04.30.png

怒られた時のtasks.jsonとlaunch.jsonを一応

スクリーンショット 2021-08-25 15.40.08.png

スクリーンショット 2021-08-25 15.03.21.png

cppdbgがArm系だとだめっぽい(?)

解決策

CodeLLDBをインストール

スクリーンショット 2021-08-25 15.04.53.png

launch.jsonを修正

"type": cppdbg"type": lldbに書き換え
スクリーンショット 2021-08-25 15.05.37.png

launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "clang++ - アクティブ ファイルのビルドとデバッグ",
            // "type": "cppdbg",
            "type": "lldb",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "C/C++: clang++ アクティブなファイルのビルド"
        }
    ]
}

一応tasks.jsonも載せておきます.

tasks.json
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ アクティブなファイルのビルド",
            "command": "/usr/bin/clang++",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "デバッガーによって生成されたタスク。"
        }
    ],
    "version": "2.0.0"
}
8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?