martomo / SublimeTextXdebug

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

Win10 & Vagrant: Doesn't stop on breakpoints #158

Closed nbyloff closed 8 years ago

nbyloff commented 8 years ago

However it does work when I use the xdebug_break; in my code, or put a breakpoint in the index.php file (testing on laravel homestead).

My setup:

There is no error or issues reported in the Sublime-Console.

This is my project file. Triple checked the path mapping: essentially navigated to the folders on each machine and pasted in their paths.

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "."
        }
    ],
    "settings": {
        "xdebug": {
            "url": "http://testapp.dev",
            "super_globals": true,
            "close_on_stop": true,
            "path_mapping": {
                "/home/vagrant/Code/testapp/public" : "C:/Users/myuser/www/laravel/testapp/public",
             }
        }
    }
}

Here's my xdebug.ini file on the vagrant machine

zend_extension=/usr/lib/php5/20131226/xdebug.so
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.idekey="sublime.xdebug"
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.2
xdebug.remote_log="/tmp/xdebug.log"

Here is my XDebug sublime user settings

{
    "break_on_start": false,

    // Which port number Sublime Text should listen
    // to connect with debugger engine.
    "port": 9001,

    // Maximum amount of array children
    // and object's properties to return.
    "max_children": 32,

    // Maximum amount of nested levels to retrieve
    // of array elements and object properties.
    "max_depth": 2,

}

I am using the Chrome XDebug plugin. I enable the plugin in the browser and hit CTRL + SHIFT + F9. I refresh a page, and the log file in /tmp/xdebug.log shows it's connected, and even lists off the break points I have configured, but it doesn't stop.

And again, if I put the break point in index.php instead of the controller, it stops just fine. If I put the xdebug_break; in my controller method, it breaks (don't see the yellow dot though). Also, if I set break_on_start to true, it will halt as well. But I can't set my own break points or step through and follow the dot.

Here is a sample log entry of it connecting, but it's loading a page where there's a break point in the controller, but it doesn't stop. Noticed the first line references XDEBUG_ECLIPSE even though I set my idekey. Not sure if that's a big deal, but again, it connects to Sublime Text just fine.

Log opened at 2016-01-31 21:14:20
I: Connecting to configured address/port: 10.0.2.2:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///home/vagrant/Code/testapp/public/index.php" language="PHP" protocol_version="1.0" appid="2645" idekey="XDEBUG_ECLIPSE"><engine version="2.3.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2015 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -v 1 -n show_hidden
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -v 32 -n max_children
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>

<- feature_set -i 3 -v 1024 -n max_data
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_data" success="1"></response>

<- feature_set -i 4 -v 2 -n max_depth
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="max_depth" success="1"></response>

<- breakpoint_set -i 5 -n 44 -f file%3A//C%3A%5CUsers%5Cmyuser%5Cwww%5Claravel%5Ctestapp%5Capp%5CHttp%5CControllers%5CPatientsController.php -t line
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="26450013"></response>

<- breakpoint_set -i 6 -n 72 -f file%3A//C%3A%5CUsers%5Cmyuser%5Cwww%5Claravel%5Ctestapp%5Capp%5CHttp%5CControllers%5CPatientsController.php -t line
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="26450014"></response>

<- breakpoint_set -i 7 -n 52 -f file%3A//C%3A%5CUsers%5Cmyuser%5Cwww%5Claravel%5Ctestapp%5Capp%5CHttp%5CControllers%5CTestsController.php -t line
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="7" id="26450015"></response>

<- breakpoint_set -i 8 -n 25 -f file%3A//C%3A%5CUsers%5Cmyuser%5Cwww%5Claravel%5Ctestapp%5Capp%5CHttp%5CControllers%5CTestsController.php -t line
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="8" id="26450016"></response>

<- breakpoint_set -i 9 -x "Fatal error" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="9" id="26450017"></response>

<- breakpoint_set -i 10 -x "Catchable fatal error" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="10" id="26450018"></response>

<- breakpoint_set -i 11 -x "Warning" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="11" id="26450019"></response>

<- breakpoint_set -i 12 -x "Parse error" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="12" id="26450020"></response>

<- breakpoint_set -i 13 -x "Notice" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="13" id="26450021"></response>

<- breakpoint_set -i 14 -x "Strict standards" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="14" id="26450022"></response>

<- breakpoint_set -i 15 -x "Deprecated" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="15" id="26450023"></response>

<- breakpoint_set -i 16 -x "Xdebug" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="16" id="26450024"></response>

<- breakpoint_set -i 17 -x "Unknown error" -t exception
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="17" id="26450025"></response>

<- run -i 18
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="18" status="stopping" reason="ok"></response>

Log closed at 2016-01-31 21:14:20
nbyloff commented 8 years ago

Sorry, I am going to close this issue. It was a dumb mistake on my part, but I just had to write it out to see it. I shouldn't map on the public folder, but the root project folder.

Maybe this will help someone in the future double checking their config. Everything above is correct, except I just had to delete the public folder on both ends in the path_mapping