Samsung / netcoredbg

NetCoreDbg is a managed code debugger with GDB/MI, VSCode DAP and CLI interfaces for CoreCLR.
MIT License
836 stars 103 forks source link

Is it possible to use this debugger with VS Code? #179

Closed NatElkins closed 2 weeks ago

NatElkins commented 1 month ago

I see it supports the VS Code protocol, but I don't see any documentation on how to actually use it from VS Code, just the CLI. Is this something that is supported?

Thank you!

NatElkins commented 1 month ago

I see this comment by @dkattan, so I think it must be possible. That's my exact use case, to use the debugger with Cursor.

https://github.com/Samsung/netcoredbg/pull/176#issuecomment-2393252832

gbalykov commented 1 month ago

Yes, NetCoreDbg supports VS Code Debug Adapter Protocol. You can find the protocol documentation at https://microsoft.github.io/debug-adapter-protocol/. In terms of VS Code integration, https://code.visualstudio.com/api/extension-guides/debugger-extension can be useful. In terms of Cursor integration, I've seen people sharing their configs at https://forum.cursor.com/, so this also might be useful.

veghivan commented 2 weeks ago

Yup let me show you how I got it working, launch.json:

    {
        "name": ".NET Core Launch (netcorDbg)",
        "type": "coreclr",
        "request": "launch",
        "program": "${workspaceFolder}/Gy_08_OBS_SINGL/bin/Debug/net8.0/Gy_08_OBS_SINGL.dll",
        "args": [],
        "cwd": "${workspaceFolder}",
        "console": "integratedTerminal",
        "stopAtEntry": false,
        "externalConsole": false,
        "pipeTransport": {
            "pipeCwd": "${workspaceFolder}",
            "pipeProgram": "bash",
            "pipeArgs": ["-c"],
            "debuggerPath": "/usr/bin/netcoredbg", //your install of netcoredbg
            "quoteArgs": true
        }
    },
NatElkins commented 2 weeks ago

@veghivan What architecture are you on? I'm on an M3 Mac.

veghivan commented 2 weeks ago

@veghivan What architecture are you on? I'm on an M3 Mac.

An old lenovo t470s running Arch meaning x86_64.

NatElkins commented 2 weeks ago

Thanks, I'll close this anyway as it's clearly possible, I just need to get my hands on the right binary.