vscode-php-debug: Multiple ajax calls not stopping on breakpoint

I don’t recall which version upgrade started this, but I’m running VSCode 1.38.0 now. When there are multiple ajax calls on a screen and I’ve set the breakpoint in a php file everything just hangs and it never reaches the breakpoint. I thought this might have been related to #164, but I guess not. Also #161 is not the issue because I already have the remote_autostart setting. Eventually, I just have to kill it. Also, without changing any settings, I can jump into phpstorm and debug the same screen with multiple ajax calls with no issue.

I see this in the Call Stack pane: image

PHP version: 7.0.33 XDebug version: 2.4.0

launch.json:

{
    "name": "Listen for XDebug",
    "type": "php",
    "request": "launch",
    "port": 9000
}

XDebug php.ini config:

[XDebug] xdebug.remote_enable = 1 xdebug.remote_autostart = 1 xdebug.var_display_max_children = 20 xdebug.var_display_max_data = 512 xdebug.var_display_max_depth = 5

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

This is happening to me too…

Similar to alcidesrh, I am finding that it happens when I have a break point on a file that multiple requests point at. But for that same request, if I put the break point in a file that only that request looks at, everything is fine. Even when I step into the file that would give me this problem

vscode 1.41.0, php 5.6.40, xdebug Xdebug 2.5.5

Hi!

This is a build from this branch: https://github.com/xdebug/vscode-php-debug/tree/feat/multi-session-debugging

It should handle the issue you are seeing. Do you have a chance to test it?

php-debug-0.0.0-development.zip

You can also build it yourself by checking out the said branch, running npm ci then npm run build and then node_modules/.bin/vsce package

Thanks!

Hi @degusssa! Thanks for sending the log. I was able to identify the issue. As expected it has to do with the design choice/limitation that I usually whine about here. The DAP (debug adapter protocol) extension tries to keep track of different incoming Xdebug connections and display them as threads. However as it was meant to be a one-on-one design.

So in this mess of async race conditions it happens every now and then that a connection gets continued without receiving all breakpoints. This happens where two Xdebug connections come in very closely together.

I already made a branch that redefines this behavior (https://github.com/xdebug/vscode-php-debug/tree/feat/multi-session-debugging) but with that leaves other IDEs (besides VSCode) in a deprivileged position. So I’m still sitting on that and figuring out what the best approach here could be.

I have however managed to create a small change that should stabilize this issue. I’ll make a PR shortly and let you know.