vscode-php-debug icon indicating copy to clipboard operation
vscode-php-debug copied to clipboard

Unable to distinguish running debug session from disconnected client

Open AnrDaemon opened this issue 4 years ago • 2 comments
trafficstars

PHP version: any Xdebug version: any VS Code extension version: 1.19

Your launch.json: irrelevant Xdebug php.ini config: irrelevant

Xdebug logfile (from setting xdebug.log in php.ini): irrelevant VS Code extension logfile (from setting "log": true in launch.json): irrelevant

Code snippet to reproduce: irrelevant

When you just started the debugger, it already shows "RUNNING" in call stack heading, even if no clients connected. And it will remain in "RUNNING" state, when last client disconnects. This makes it impossible to distinguish a long-running code from terminated session.

AnrDaemon avatar Oct 04 '21 16:10 AnrDaemon

Hi! Yes, I agree, that is a problem, coming from the fact that there is one VS Code Debug Session running, and connected DBGP sessions presented as Threads. Although I have a working implementation that does things differently, that would break every other IDE, as the implementation is VS Code specific.

When talking only VS Code, the best implementation would be to create a separate UI for letting the user "start dbgp listen socket" and only present connected DBGP engines as Debug Sessions...

What is doable, is that I present the DBGP listen socket as one Debug session and all others as separate Debug Sessions.. The issue I'm currently facing with this is "should the stop button close all sessions or just stop listening?" I think #571 is relevant here also...

This is the current implementation #517 I'll add some screenshots how it looks...

zobo avatar Oct 06 '21 09:10 zobo

"should the stop button close all sessions or just stop listening?"

Can't it be both? I actually suggest two buttons:

  • Stop (the "square", terminate current thread)
  • Close debugger (red "codicon-close") - close socket and terminate all current sessions.
  • Alt+Close (the "codicon-debug-disconnect" mark) - close listening socket, but only terminate debugger if no sessions left active.

AnrDaemon avatar Oct 06 '21 13:10 AnrDaemon