How to setup scsynth debugging?

It’s much easier and more reliable to get vscode / lldb to attach to a running scsynth process than it is to get sclang to attach to a remotely running scsynth. I use this:

{         // .vscode/launch.json 
    "configurations": [

        {
            "type": "lldb",
            "request": "attach",
            "name": "Attach",
            "program": "${workspaceFolder}/build-Debug/Install/SuperCollider/SuperCollider.app/Contents/MacOS/sclang",
            "waitFor": true
        }
  ]
}

You’ll have to adjust the path to reflect the structure of your build folder and which executable you want to debug (this is for sclang, but you can make another entry for scsynth as well). IIRC the waitFor parameter doesn’t work right, making it hard to catch bugs that occur AS the server is booting, but otherwise I find this works well.

1 Like