netcoredbg icon indicating copy to clipboard operation
netcoredbg copied to clipboard

add 'noDebug' support for launch configurations

Open noam-sol opened this issue 2 years ago • 4 comments

Hey :) from dap spec - https://microsoft.github.io/debug-adapter-protocol/specification -

interface LaunchRequestArguments {
  /**
   * If true, the launch request should launch the program without enabling
   * debugging.
   */
  noDebug?: boolean;

  /**
   * Arbitrary data from the previous, restarted session.
   * The data is sent as the `restart` attribute of the `terminated` event.
   * The client should leave the data intact.
   */
  __restart?: any;
}

passing noDebug: true is ignored and the process is debugged (e.g. breakpoints are breaking)

noam-sol avatar Jul 06 '23 09:07 noam-sol

This looks like normal application start like dotnet run do. Not sure we could implement this easelly for all supported OSes, since we start it with dbgshim now that also init debug api from the beginning. Even if we will ignore all callbacks from debuggee runtime, this will be not the same as real "no debug"/"normal" launch because debuggee process runtime will be work in another way.

viewizard avatar Jul 06 '23 09:07 viewizard

Is there a problem to implement such dotnet run <dll>? If dotnet isn't in $PATH then I guess it can either fail or allow configuring a dotnet installation location via configuration. Having a noDebug option is useful, as it supports DAP output redirection, launching directly from VSCode using the same run configuration and not just compiling and running from a shell.

gfszr avatar Jul 10 '23 15:07 gfszr

We can't just wrap around dotnet run since not all out targets have dotnet tool at all. From another side we don't plan add CLR corhost implementation inside debugger, as I know.

CC @gbalykov

viewizard avatar Jul 10 '23 15:07 viewizard

@noam-sol @gfszr Thank you for interest to the project. We don't have plans for this now, but we are open for contributions if you would like to implement this yourself.

gbalykov avatar Jul 11 '23 07:07 gbalykov