Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Who should terminate the debugger? #38

Closed
DonJayamanne opened this issue Feb 5, 2018 · 2 comments
Closed

Who should terminate the debugger? #38

DonJayamanne opened this issue Feb 5, 2018 · 2 comments

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Feb 5, 2018

@ericsnowcurrently @int19h @karthiknadig

When terminating the debugger using VS Code, the disconnect request is sent by the client (VS Code).
Currently this request is handled and a response is sent back by PTVSD, but nothing happens.

However VS Code expects two other things to take place:

Looking at the existing code, PTVSD doesn't terminate itself.

So the question is who is responsible for terminating the debugger (the PTVSD/debugger process):

  • Should PTVSD terminate its own process when it receives the disconnect request
    I believe this is the right place (as this is where the protcol is handled and responses are sent).
  • Should the VS Code adapter proxy code (the code I'm writing) be responsible for terminating this PTVSD process?
@DonJayamanne DonJayamanne changed the title Who should terminate the debugger Who should terminate the debugger? Feb 5, 2018
@int19h
Copy link
Contributor

int19h commented Feb 5, 2018

It depends on the semantics that we want for disconnect to have in remote debugging scenarios (or local ones, but where the script is started manually rather than via F5). Our old debugger doesn't terminate the process on disconnect, and you can later connect to it again to continue debugging. Also, in VS at least, when you attach rather than launch, the button to stop debugging says "Detach" rather than "Terminate", and not terminating the process is standard behavior for all other debuggers.

If we want to conform to that behavior, then ptvsd should ignore disconnect as it usually does, and the adapter should terminate the debuggee process if and only if it launched it.

@DonJayamanne
Copy link
Contributor Author

the adapter should terminate the debuggee process if and only if it launched it.

Got my answer, VS Code (the adapter layer I'm working on) will launch and terminate this process.
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants