Debugger not stopping at breakpoint in VS Code with C/C++ Extension on Mac

-1

Here are my config files:

launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
      {
          "name": "(lldb) Launch",
          "type": "cppdbg",
          "request": "launch",
          "program": "${workspaceFolder}/test",
          "args": [],
          "stopAtEntry": true,
          "cwd": "${workspaceFolder}",
          "environment": [],
          "externalConsole": true,
          "MIMode": "lldb",
          "targetArchitecture": "x86_64"
      }
  ]
}

c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/local/Cellar/gcc/7.1.0/include/c++/7.1.0",
                "/usr/local/Cellar/gcc/7.1.0/include/c++/7.1.0/x86_64-apple-darwin16.5.0"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/System/Library/Frameworks",
                "/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

tasks.json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "g++ -g test.cpp -o test", 
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher":"$gcc"
        }
    ]
}

Debugging functionality stopped working after an OS upgrade.

Running Mac OS Catalina 10.15.3

Running gcc --version

gives:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Code runs on execution, but debugger doesn't stop on break point. Here is the terminal output:

Launching: '/Users/m/Workspace/VSCode/test'
Working directory: '/Users/m/Workspace/VSCode'
1 arguments:
argv[0] = '/Users/m/Workspace/VSCode/test'
Hello WOrldProcess exited with status 0

Debug Console in VS Code shows the following:

=thread-selected,id="1"
The program '/Users/m/Workspace/VSCode/test' has exited with code 0 (0x00000000).

How do I make it start working again? I've checked I have put in break points and VS Code recognizes them, because I see them in the left side window.

c++
debugging
visual-studio-code
asked on Stack Overflow Feb 13, 2020 by user3760100 • edited Feb 13, 2020 by user3760100

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0