C++ debugging with Visual Studio Code High Sierra

1

I'm trying to get c++ debugging working on mac os high sierra. Here is my launch.json file. I not really sure how to get it running.

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "/Users/user/Desktop/VSCodeProjects/test",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "lldb"
        }
    ]
}

When I do hit the debug button Visual Studio Code will just show me the debug buttons and then will give me the following error message.

Loaded '/usr/lib/system/libsystem_networkextension.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_notify.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_sandbox.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_secinit.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_kernel.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_platform.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_pthread.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_symptoms.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_trace.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libunwind.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libxpc.dylib'. Symbols loaded.
Loaded '/usr/lib/closure/libclosured.dylib'. Symbols loaded.
Loaded '/usr/lib/libobjc.A.dylib'. Symbols loaded.
Loaded '/Users/jeffomidvaran/Desktop/VSCodeProjects/test'. Symbols loaded.
The program '/Users/user/Desktop/VSCodeProjects/test' has exited with code 0 (0x00000000).
c++
debugging
visual-studio-code
osx-high-sierra
asked on Stack Overflow Jun 30, 2018 by code kid

1 Answer

0

Most of the time when people run into this problem it is because they have not compiled with debug symbols enabled. For clang, you can specify the -g flag and that will make the program debuggable. Without debug symbols, the debugger doesn't know the code to execution line information so it won't be able to set the breakpoint.

You can post over on our Extension's GitHub site for more help.

answered on Stack Overflow Sep 20, 2018 by Pie

User contributions licensed under CC BY-SA 3.0