martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

Breakpoints ignored (Vagrant, Samba) #115

Closed mbrodala closed 9 years ago

mbrodala commented 9 years ago

I have the following setup:

User settings (same for all VMs):

{
  "path_mapping": {
    "/var/www": "Z:/"
  },
 // ...
}

Xdebug configuration:

[xdebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_host = "10.0.2.2"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
xdebug.remote_log = "/var/log/xdebug.log"

If I set a breakpoint the status line says:

Xdebug: Waiting for response from debugger engine.

There is also a Xdebug.breakpoints file properly created in Sublime's User package with this content:

{"Z:\\path\\to\\File.php": {"195": {"enabled": true, "id": null, "expression": null}}}

The Xdebug.log says this:

[10/30/2014 09:02:58AM] INFO - ==== Loading 'Xdebug Client.sublime-package' package ==== [10/30/2014 09:02:58AM] INFO - Failed to open C:\Users\mbrodala\AppData\Roaming\Sublime Text 3\Packages\User\Xdebug.expressions. [10/30/2014 09:02:58AM] INFO - Failed to parse C:\Users\mbrodala\AppData\Roaming\Sublime Text 3\Packages\User\Xdebug.expressions.

At no time is anything written to /var/log/xdebug.log within the VM.

The debugging connection basically works since the break_on_start setting properly halts exection and the status line says this upon reloading the page:

Xdebug: Finished executing file on server. Reload page to contine debugging.

Am I doing something wrong?

mbrodala commented 9 years ago

I gave it another try today and it's still the same. Debugging does not work.

mbrodala commented 9 years ago

I finally got it working and as it seems the issue boils down to the path_mapping option. This is how it should look like:

{
  "path_mapping": {
    "/var/www": "Z:"
  },
}

Notice that there is no trailing slash anymore on the local drive letter. It also works if both sides end with a slash. Previously a path like file:///var/wwwpath/to/file.php was used if a breakpoint is added to Z:\path\to\file.php which is bound to fail.

My xdebug configuration is now reduced to this thanks to default values:

[xdebug]
xdebug.remote_host = "10.0.2.2"
xdebug.remote_enable = 1