Issues when remote debugging

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Issues when remote debugging

Postby davidbcn » February 13th, 2017, 5:56 pm

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.
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: Issues when remote debugging

Postby Miloslav Beno » February 15th, 2017, 11:22 am

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!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1002
Joined: January 7th, 2012, 8:36 pm

Re: Issues when remote debugging

Postby davidbcn » April 25th, 2017, 7:41 am

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.
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: Issues when remote debugging

Postby davidbcn » April 25th, 2017, 7:44 am

Also... PHP Tools should be a little more verbose on the OUTPUT window while debugging to help troubleshoot thsese kind of things.
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: Issues when remote debugging

Postby Miloslav Beno » April 27th, 2017, 8:38 am

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!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1002
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 3 users online :: 1 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: Bing [Bot] and 2 guests
Phalanger