microsoft / vscode-mono-debug

A simple VS Code debug adapter for mono
Other
163 stars 174 forks source link

Use MONO_ENV_OPTIONS to pass the debug arguments to mono #66

Closed thaystg closed 4 years ago

thaystg commented 4 years ago

This allows passing the arguments to e.g. a mono built from the dotnet/runtime repo since the executable doesn't take the usual mono options.

Example of launch.json:

{
            "type": "mono",
            "request": "launch",
            "name": "mono-netcore",
            "program": "/Users/thaysgrazia/runtime/artifacts/bin/MyConsoleApp/Debug/net5.0/MyConsoleApp.dll",
            "runtimeExecutable": "/Users/thaysgrazia/runtime/.dotnet-mono/dotnet"
}
akoeplinger commented 3 years ago

This caused an issue because the MONO_ENV_OPTIONS was inherited to subprocesses so they were waiting for a debugger to attach.

I made this feature opt-in with a configuration option which is off by default: passDebugOptionsViaEnvironmentVariable in 488eff12