Tuesday, 6 August 2019

Xdebug with Visual Studio Code ignores some breakpoints

I am using Visual Studio Code with the PHP Debug extension to debug a Laravel project. But some breakpoints are ignored and I cannot figure out why. I insist on the fact that not all breakpoints are ignored. For instance all breakpoints at method declarations are ignored but those at variable declarations are hit.

The Xdebug part of my php.ini:

xdebug.profiler_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back=1
xdebug.remote_enable = 1
xdebug.remote_port = 9000

This is my launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9001,
            "log": true
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

What I tried:

  • Changing the default port 9000 to 9001
  • Uninstalling and reinstalling the PHP debug extension (you never know)

How to get Xdebug with Visual Studio Code hitting all breakpoints or is this normal behaviour? Thank you in advance for your help.



from Xdebug with Visual Studio Code ignores some breakpoints

No comments:

Post a Comment