Page 1 of 1

Issues when remote debugging

PostPosted: February 13th, 2017, 5:56 pm
by davidbcn
I still have tons of issues when remote debugging and the first file on remote server does not exist in local project.

I properly setup manual path mapping.

What happens is that XDEBUG is able to connect back to PHP Tools, but PHP Tools fails to "answer back".

This is what is registered in the XDEBUG remote log:

og opened at 2017-02-13 17:52:33
I: Connecting to configured address/port: 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///D:/_Webs/php_envivo/runtime/loader.inc" language="PHP" xdebug:language_version="7.0.1-dev" protocol_version="1.0" appid="59640" idekey="5815C1C4"><engine version="2.4.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>

And this is what is shown in output window:

Auto-attach to process '[16344] PHP.Debugger.Systray.exe' on machine 'DESKTOP-P0Q9JJQ' succeeded.

Then the request gets stuck forever as XDEBUG is expecting a response from PHP Tools without success.

Re: Issues when remote debugging

PostPosted: February 15th, 2017, 11:22 am
by Miloslav Beno
Hi David,

Thanks for the feedback.

We've tried to reproduce it, but without success. Could you give us more info?
- What mapping settings do you use?
- What server do you use? ( Likely this is not important, but I want to set it up as you have)

Thanks!

Re: Issues when remote debugging

PostPosted: April 25th, 2017, 7:41 am
by davidbcn
Have some extra details on this...

The issue is not with path mapping whatsoever. The issue happens intermitently, and I have been able to "trim down" the behaviour:

* The XDebug remote debugger tries to connect back to PHP Tools, the connection is established and XDebug waits for information about breakpoints.
* PHP Tools is stuck in some sort of internal operation (can take up to several minutes, looks like related to scanning the PHP files).
* Until PHP tools is finished doing whatever it is doing internally, any Xdebug session will "hang" waiting for PHP tools response.
* Once PHP tools finishes doing it's stuff, debugger works fine again.

I don't know details about the XDebug protocol, but looks like after the first handshake XDebug will wait for breakpoint information from the debugger. This is were PHP Tools gets stuck.

You should inspect that part of the implementation and try to figure out what situations / blocking operations will prevent PHP Tools from sending back breakpoing information after the handshake. Note that if left for long enough (many minutes sometimes) PHP Tools will eventually respond.

Re: Issues when remote debugging

PostPosted: April 25th, 2017, 7:44 am
by davidbcn
Also... PHP Tools should be a little more verbose on the OUTPUT window while debugging to help troubleshoot thsese kind of things.

Re: Issues when remote debugging

PostPosted: April 27th, 2017, 8:38 am
by Miloslav Beno
Hi David,

Thanks for more detailed info.

Do you know if this is something new or it was occuring before?

I'm checking the debugger and I don't see anything which could cause delay in breakpoint resolution. Verbose output would be certainly good option to debug these kind of things.

However in this case I suspect there are other parts of PHP Tools or VS which takes main thread and occuppies it for some time until our debugger gets a chance to send breakpoint info to Xdebug.

We could plan direct session and try to debug it together. I would attach with other VS and when it gets stuck check what main thread is doing.

Thanks!