Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Debugger can't terminate on program end #11

Closed
roblourens opened this issue Sep 7, 2016 · 6 comments · Fixed by #112
Closed

Debugger can't terminate on program end #11

roblourens opened this issue Sep 7, 2016 · 6 comments · Fixed by #112
Labels
Milestone

Comments

@roblourens
Copy link
Member

Currently, when the script terminates and a debugger is attached, Node waits for the debugger to detach before quittting, but the debugger has no way to know. I think a result of nodejs/node#7088

Already tracked in - nodejs/node#7742

@roblourens roblourens added bug and removed bug labels Sep 7, 2016
@roblourens
Copy link
Member Author

Node in some versions has a similar issue, so this probably isn't high priority.

@roblourens
Copy link
Member Author

I could listen on stderr for "Waiting for the debugger to disconnect..." but not a good solution

@mousetraps
Copy link

Interestingly, after hitting this issue, I pressed step over a gazillion times, and the process actually exited at the end.

@rianadon
Copy link
Contributor

Now that nodejs/node#7742 has been resolved, what needs to be done to fix this?

I'd be happy to provide a PR but given that the bulk of functionality comes from vscode-chrome-debug-core, I'm not sure where to fix this.

@roblourens
Copy link
Member Author

Thanks for pointing that out, I should have subscribed to the issue. A PR would be awesome, it should be fairly simple. The fix will be in this repo, at least for now.

Override protected hookConnectionEvents(): void { from -core's ChromeDebugAdapter. Add a listener for the Runtime.executionContextDestroyed event. Check that the id=1 (I don't know what else in node would cause a context to be created and destroyed? And call terminateSession when that happens.

rianadon added a commit to rianadon/vscode-node-debug2 that referenced this issue Jun 19, 2017
@rianadon
Copy link
Contributor

Thanks for all those instructions! If you haven't already seen it the PR is #112.

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

Successfully merging a pull request may close this issue.

4 participants