C++ debug is stuck when using llvm on a Mac with M2 processor

Viewed 31

I have a simple code as follows:

#include <iostream>
#include <map>

int main()
{
    std::map<int, int> a;
    for (int i=0; i<10; i++)
        a[i] = i+1;
}

When I try to debug the code using llvm (both apple version and brew version), it gets stuck. There is also a process called lldb-mi with 100% CPU usage running in the background even if I stop the debug in VS code. Any idea for that?

OS version: macOS Monterey 12.5. MacBook Air with M2 processor.

task.json file:

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ build active file",
            "command": "/usr/bin/clang++",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}
0 Answers
Related