Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant, PhpStorm, HHVM and Xdebug

I'm having problems getting PhpStorm and the internal Xdebug in HHVM playing nicely on a vagrant box, below is my php.ini.

xdebug.enable=1
xdebug.remote_enable=1
xdebug.idekey="PHPSTORM"
xdebug.remote_host="10.0.2.2"
xdebug.remote_autostart=0
xdebug.remote_connect_back=1

PhpStorm is listening on Port 9000, if I remove all remote servers upon first run PhpStorm gives me the usual "Incoming Connection from Xdebug".

After I select the correct mapping and the first breakpoint is hit HHVM appears to hang before returning a 504 Gateway Time-out. If I remove the breakpoint then the load is instant, so clearly the PhpStorm and Xdebug appear to be communicating, but the debug window never shows any stack info / break point controls.

Does anyone have any pointers please, my thoughts are: 1) I need to open a port on the Vargrant box as communication is hanging somewhere 2) Bug in HHVM / PhpStorm (Unlikely)

I'm on Ubuntu 14.04, Vagrant 1.6.5

VM is also 14.04 with Nginx + HipHop VM 3.4.1, Extension API: 20140829

PhpStorm 8.0.2


I have now enabled logging on the vagrant box for Xdebug remote connections, this is the output....

Log opened at[2014-12-18 14:59:16]
I: Checking remote connect back address.
I: Remote address found, connecting to 192.168.56.1:9089.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/public/index.php" language="PHP" protocol_version="1.0" appid="9660" idekey="PHPSTORM"><engine version=""><![CDATA[xdebug]]></engine><author><![CDATA[HHVM]]></author><url><![CDATA[http://hhvm.com/]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <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 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

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

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

<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="break" reason="ok" command="step_into" transaction_id="5"><xdebug:message lineno="12" filename="file:///var/www/public/index.php"></xdebug:message></response>

<- breakpoint_set -i 6 -t line -f file:///var/www/public/index.php -n 32
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="18" state="enabled"></response>

A very peculiar thing happens though, if I click the "Add method to skip list" button in PhpStorm, It continues communicating with XDebug as if stepping through variables, one with each click...

<- stack_get -i 8
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="8"><stack where="{main}" level="0" type="file" filename="file:///var/www/public/index.php" lineno="12"></stack></response>

Eventually the expected controls are shown after several of these "stack_get" calls have been hackily stepped through in this manner.

Does anybody have any suggestions?

like image 292
Andy Avatar asked Dec 18 '14 10:12

Andy


1 Answers

This issue has now been closed on github: https://github.com/facebook/hhvm/issues/4488

like image 60
Andy Avatar answered Nov 02 '22 12:11

Andy