benibenj / vscode-pythonCpp

A Visual Studio Code Debug Extension for debugging mixed Python and C++ code. The extension starts a Python debug session and attaches the C++ debugger to it. This extension is useful for debugging Python programs that call functions from shared libraries (.so/.dll).
Other
47 stars 7 forks source link

support for mac #29

Open gideonKogan opened 5 months ago

gideonKogan commented 5 months ago

I have failed to use the debugger on mac. Is it supported?

gideonKogan commented 5 months ago

I have modified the lunch.json to

 // 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": "Python C++ Debugger",
            "type": "pythoncpp",
            "request": "launch",
            "pythonLaunchName": "Python: Current File",
            "cppAttachName": "(gdb) Attach"
        },
        {
            "name": "(gdb) Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "/usr/local/bin/python",
            "processId": "",
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/local/bin/gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

getting the following error: Unable to start debugging. Program path '/usr/local/bin/python' is missing or invalid.

GDB failed with message: Unable to find Mach task port for process-id 61554: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8))

This may occur if the process's executable was changed after the process was started, such as when installing an update. Try re-launching the application or restarting the machine