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

Debugger occasionally not sending proxy stop command when using dbgpProxy

Open mjohn425 opened this issue 3 years ago • 4 comments

When connecting through to a proxy, occasionally VSCODE won't send the disconnect command when stopping the debugger, have created a work around by creating a task that always sends the proxystop command on completion. Can repeatably make this happen by getting xdebug set on a breakpoint and then trying to load a second page (without breakpoint) and then stopping debugger before the second page loads.

Causes debugger to not be able to connect back as it thinks an IDE is already connected with that key without restarting dbgp or manually sending proxystop command.

Suggested to either find out why IDE doesn't deregister or include an option such as reregisterOnStart which runs a proxystop before the proxyinit command.

PHP version: 7.4 Xdebug version: 2.9.8 & 3.1.1 VS Code extension version: v1.22.0

Your launch.json: { "name": "Listen for Xdebug Marty", "type": "php", "request": "launch", "port": 0, "proxy": { "enable": true, "host": "10.0.0.24", "port": 9001, "key": "VSCODEMARTY", }, "postDebugTask": "Fix XDEBUG" },

mjohn425 avatar Nov 11 '21 03:11 mjohn425

Hi @mjohn425 !

Thanks for reporting. I'll try to reproduce the issue as you described.

I had an idea to provide a vscode command for proxy init and stop, just not sure if you can use that in postDebugTask...

zobo avatar Nov 11 '21 08:11 zobo

It's not very well documented but after having a play around I'm pretty sure the below should work. Currently my post debug task just pipes the command into netcat but it works haha.

"tasks": [
     {
        "label": "Deregister Proxy",
        "command": "${command:php.debug.deregisterProxy}",
      },
]

mjohn425 avatar Nov 11 '21 11:11 mjohn425

It don't work for me lamentably, that deregisterProxy command is not available for VSCode

image

jota0222 avatar Feb 17 '23 16:02 jota0222

I don't think I managed to add this yet. I have an idea how to do it.

zobo avatar Feb 18 '23 09:02 zobo