When I'm running a debugging session on a specific CLI script with the xdebug listener on, it hangs. It appears to be waiting for the script to get to a break point (which is set). But the thing is that debugging works on other scripts just fine. To try and see what is going on, I stopped the script at the first line (which works as expected) and stepped through the code each time looking for the function that hangs where I set a break point and remove any previous break points. Then I run the script again and at the break point, I step into the function and step over any function looking for the one that hangs. Ultimately, I finally came to the following line that, when I attempt to step into the function, it simply hangs:
$error = pcntl_exec($found_script, $arguments, $env);
As you can see, it's a function that launches a script inside the current process (this is in drush - drush/drush/includes/startup.inc:294).
The interesting thing is that if I set a break point at that line and then execute the script, the debugging session will start and pause at that breakpoint. Then I can hit the play button to make it hang. But after that I hit the stop button and the script proceeds just like it should. This is reasonably new behavior, I've been using this workaround for about a month and haven't found any solutions as of yet. Prior to the past month, the debugging sessions worked as expected and didn't hang at the pcntl_exec line. But now, even after I got a new computer, I can't get any debugging to work unless I use the workaround.
Does anyone have any ideas how to fix this?