XDebug Remote Debugger seems to jump to random locations

Answered

I am using PHPStorm (latest Version) and Xdebug 2.7 for Remote Debugging with the following Configuration

php.ini:

[Xdebug]
zend_extension="C:\xampp\php\ext\php_xdebug-2.7.0alpha1-7.0-vc14.dll"
xdebug.remote_enable=true
xdebug.remote_port="9000"
xdebug.remote_connect_back=true
xdebug.remote_autostart=1
xdebug.collect_return="0"
xdebug.profiler_enable=0;

xdebug.remote_log="D:\xampp\logs\xdebug.log"

xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host = 192.168.1.129

PhpStorm: enter image description here

My Problem is, that the Debugger always stops at the first Breakpoint i set (doesnt matter where i set it in the Code) but when i continue the Execution it seems to jump to a random location in the code. Doesn't make any difference here if i use "step into, "step over" or "continue". I checked if any key on the keyboard is stuck but i can't find anything here and i also cleaned the browser cache and invalidated the PHPStorm Caches. After some random time it works normally again and i can step around like i want.

The other weird part is, that it always jumps to the same random location from every set breakpoint, but every breakpoint got another random location.

I got this problem like every 2nd or 3rd day at the moment for a few hours and just can't figure out what is going on here. Is there maybe a shortcut or anything like that, that i activated without knowing it? Really Thankful for any Idea you got to help me!

0
6 comments

Here's a relevant thread, although I've never stumbled upon this myself: https://youtrack.jetbrains.com/issue/WI-24557
What is worth trying:

1. Disable Force break at first line for all cases.
2. Remove all watches if any are there.
3. Check if you have any weird conditional breakpoints set in Run | View Breakpoints.

1
Avatar
Permanently deleted user

Thanks for your reply @ Eugene Morozov. I already disabled to break at first line and removed all breakpoints.
I reinstalled PhpStorm and Xampp and then it worked again for now. If the bug comes up again i will also try to remove the watches - good Idea!

1

So i just had the problem again and it seems that removing the watches fixes it. I will keep an eye on this and post an update if the error occures again and removing the watches doesn't fix it.

1

I have the same issue and I have no idea why is this happening and how to debug and fix this. I don't have watchers. I have pretty generic code with static calls, for some reason, x-debug just fall out from the program execution flow.

0

O Bardiuk

What is your Xdebug and PhpStorm versions?

If it's PhpStorm 2022.2 version then upgrade to 2022.2.1 or even 2022.2.2 Preview Build.

If it's still an issue after upgrading to the latest version, please check the workaround in https://youtrack.jetbrains.com/issue/WI-67891

1

Please sign in to leave a comment.