Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » XDebug JIT fails ... somewhere
XDebug JIT fails ... somewhere [message #91166] Wed, 21 January 2009 15:06 Go to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

The configuration:

Using PDT 2.0 all-in-one out-of-the-box from this site.

XDebug JIT is set to "any"

The only PHP server (also default):
*url: https://host
*path on server: /foo/bar/host/htdocs-ssl
*local path: /project_name/htdocs-ssl

NB! Thous two point to the same (physical) folder.

The only defined debug configuration:
file: /project_name/htdocs-ssl/x.php
autogen: off
autogen-url: /x.php

Executing this debug config manually - everything works as expected.

However, if no debug config was chosen before and debug session is
initiated by client - an <unknown> configuration is used - that obviously
fails miserably.

JIT works only when some config has been loaded and ended but not removed
- which is quite annoying extra step to start debugging.

Bug or misconfiguration ?
Re: XDebug JIT fails ... somewhere [message #91181 is a reply to message #91166] Wed, 21 January 2009 16:05 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
The remote session initiation doesn't attempt to look for any predefined web launch configuration
nor does it attempt to look for any predefined server definition. It creates a temporary launch
configuration (seen as <unknown>). So it is working as currently designed in that respect.

How exactly does this fail for you ?

Dave Kelsey

Hell No wrote:
> Hi,
>
> The configuration:
>
> Using PDT 2.0 all-in-one out-of-the-box from this site.
>
> XDebug JIT is set to "any"
>
> The only PHP server (also default):
> *url: https://host
> *path on server: /foo/bar/host/htdocs-ssl
> *local path: /project_name/htdocs-ssl
>
> NB! Thous two point to the same (physical) folder.
>
> The only defined debug configuration:
> file: /project_name/htdocs-ssl/x.php
> autogen: off
> autogen-url: /x.php
>
> Executing this debug config manually - everything works as expected.
>
> However, if no debug config was chosen before and debug session is
> initiated by client - an <unknown> configuration is used - that
> obviously fails miserably.
>
> JIT works only when some config has been loaded and ended but not
> removed - which is quite annoying extra step to start debugging.
>
> Bug or misconfiguration ?
>
Re: XDebug JIT fails ... somewhere [message #91226 is a reply to message #91181] Thu, 22 January 2009 07:03 Go to previous messageGo to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
> The remote session initiation doesn't attempt to look for any predefined
> web launch configuration nor does it attempt to look for any predefined
> server definition. It creates a temporary launch configuration (seen as
> <unknown>). So it is working as currently designed in that respect.

Hm, but how does it find the relevant php source then?

I have used this functionality before and it more-or-less worked. However,
no path mapping was needed there and it failed to open the file in given
project - opening the file directly instead. This failure to see that the
files are the same is/was very annoying, but at least it worked.

> How exactly does this fail for you ?

It fails to find the relevant source. If "break on first line" is not set
- then nothing happens (breakpoints get ignored). If it is checked i get
"Source not found for /foo/bar/host/htdocs-ssl/x.php.{main} : lineno 2.
Please add the file to the project or the projects Include Path, or
structure the files in Project/Include Path to more closely resemble the
layout of the files on the server."

I have to tell it somewhere where it can find the files - but if
server/config path mappings are ignored then where can i do that?

It needs to map:
"/foo/bar/host/htdocs-ssl" => "/project_name/htdocs-ssl" or "P:\htdocs-ssl"
preferably to "/project_name/htdocs-ssl" as eclipse/pdt (whatever is
responsible of it) fails to see direct paths to equal project path.

The only workaround i have currently is to start the debug session with
correct path mappings manually -> then immediately end the session, but
not remove it -> close the spawned browser sessions. After that JIT works
as expected.

>> The only PHP server (also default):
>> *url: https://host
>> *path on server: /foo/bar/host/htdocs-ssl
>> *local path: /project_name/htdocs-ssl
>>
>> NB! Thous two point to the same (physical) folder.
Re: XDebug JIT fails ... somewhere [message #91257 is a reply to message #91226] Thu, 22 January 2009 08:33 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
What should happen is that when the remote session is initiated, you should be prompted to select an
appropriate file from your workspace which matches the one seen by xdebug on the initiation of the
script. Once you select that file, a path mapping is created for that debug session only that maps
between the remote file and your files in the workspace.

It should open the local file, but it isn't opened as a workspace file instead it opens it as an
external file within PDT because there is no source path locator associated with this launch (see
bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=259988 )

What it sounds like to me is that you are not being prompted to select a file that matches the file
first executed which then creates the required path mapping.

This was a bug introduced in an earlier build of PDT when include paths were introduced but should
be fixed for the ga release.

Did you create a new PDT project from scratch to test this ? imported old projects may not work due
to the include path feature added.


Dave Kelsey
Re: XDebug JIT fails ... somewhere [message #91346 is a reply to message #91226] Thu, 22 January 2009 13:05 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
One final thing to check is the initial script defined on the include path ?

Dave Kelsey

Hell No wrote:
>> The remote session initiation doesn't attempt to look for any
>> predefined web launch configuration nor does it attempt to look for
>> any predefined server definition. It creates a temporary launch
>> configuration (seen as <unknown>). So it is working as currently
>> designed in that respect.
>
> Hm, but how does it find the relevant php source then?
> I have used this functionality before and it more-or-less worked.
> However, no path mapping was needed there and it failed to open the file
> in given project - opening the file directly instead. This failure to
> see that the files are the same is/was very annoying, but at least it
> worked.
>
>> How exactly does this fail for you ?
>
> It fails to find the relevant source. If "break on first line" is not
> set - then nothing happens (breakpoints get ignored). If it is checked i
> get "Source not found for /foo/bar/host/htdocs-ssl/x.php.{main} : lineno
> 2. Please add the file to the project or the projects Include Path, or
> structure the files in Project/Include Path to more closely resemble the
> layout of the files on the server."
>
> I have to tell it somewhere where it can find the files - but if
> server/config path mappings are ignored then where can i do that?
>
> It needs to map:
> "/foo/bar/host/htdocs-ssl" => "/project_name/htdocs-ssl" or "P:\htdocs-ssl"
> preferably to "/project_name/htdocs-ssl" as eclipse/pdt (whatever is
> responsible of it) fails to see direct paths to equal project path.
>
> The only workaround i have currently is to start the debug session with
> correct path mappings manually -> then immediately end the session, but
> not remove it -> close the spawned browser sessions. After that JIT
> works as expected.
>
>>> The only PHP server (also default):
>>> *url: https://host
>>> *path on server: /foo/bar/host/htdocs-ssl
>>> *local path: /project_name/htdocs-ssl
>>>
>>> NB! Thous two point to the same (physical) folder.
>
Re: XDebug JIT fails ... somewhere [message #91510 is a reply to message #91257] Fri, 23 January 2009 07:28 Go to previous messageGo to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
Dave Kelsey wrote:

> What should happen is that when the remote session is initiated, you
> should be prompted to select an appropriate file from your workspace
> which matches the one seen by xdebug on the initiation of the script.
> Once you select that file, a path mapping is created for that debug
> session only that maps between the remote file and your files in the
> workspace.

That prompt indeed does not show up. It does show up with local projects
though.

I interpret the given error as it failing to find any candidates to choose
from.

One more tid-bit that might or might not be of use: all source folders in
the problematic project are linked: project_name/folder -> P:\folder where
P is a mapped drive /foo/bar/host/folder.

> see bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=259988

Good to know that that particular problem is known.

> Did you create a new PDT project from scratch to test this ? imported
> old projects may not work due to the include path feature added.

I recreated all projects - nothing from older installations was ever used.

> One final thing to check is the initial script defined on the include path ?

Under PHP Include path is the project itself - that includes the initial
script as it is part of the project. ... if i understood the question.
Re: XDebug JIT fails ... somewhere [message #91526 is a reply to message #91510] Fri, 23 January 2009 08:28 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
Sounds like linked folders could be the issue here.

Dave Kelsey

Hell No wrote:
> Dave Kelsey wrote:
>
>> What should happen is that when the remote session is initiated, you
>> should be prompted to select an appropriate file from your workspace
>> which matches the one seen by xdebug on the initiation of the script.
>> Once you select that file, a path mapping is created for that debug
>> session only that maps between the remote file and your files in the
>> workspace.
>
> That prompt indeed does not show up. It does show up with local projects
> though.
>
> I interpret the given error as it failing to find any candidates to
> choose from.
>
> One more tid-bit that might or might not be of use: all source folders
> in the problematic project are linked: project_name/folder -> P:\folder
> where P is a mapped drive /foo/bar/host/folder.
>
>> see bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=259988
>
> Good to know that that particular problem is known.
>
>> Did you create a new PDT project from scratch to test this ? imported
>> old projects may not work due to the include path feature added.
>
> I recreated all projects - nothing from older installations was ever used.
>
>> One final thing to check is the initial script defined on the include
>> path ?
>
> Under PHP Include path is the project itself - that includes the initial
> script as it is part of the project. ... if i understood the question.
>
Re: XDebug JIT fails ... somewhere [message #91567 is a reply to message #91526] Fri, 23 January 2009 14:20 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
So I have tried to recreate your scenario as follows with a simple script

linux system:
/home/me/shared/level1/level2/myProg.php
/home/me shared as a SMB drive as "me"
windows system:
P:\ is a shared drive connected to "me"

PDT:
I have a new project called BugTest
I have a single linked folder to p:\shared called "shared"
I have break on first line (there are some issues to do with breakpoints related to the noted
bugzilla so this keeps it simple)
Remote Session Initiation is enabled
BugTest is in my include path


on the linux box I invoke from /home/me
php shared/level1/level2/myprog.php

on PDT I get prompted to select the file BugTest shared/level1/level2/myProg.php, which I select
and everything works.

So in my scenario, linked folders are searched, and it searches all include paths for the script
name that is initially invoked, so if you have a script (with the exact same case, ie myprog.php is
not the same as myProg.php) in multiple directories or even in different projects in the include
path it should find them.

You can check exactly what script is being looked for by turning on xdebug logging by adding
xdebug.remote_log=<filename> to your php.ini file. Look for the following in the log

Log opened at 2008-10-16 10:46:01
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///C:/ht%20docs/phpcode/debug.php" language="PHP" protocol_version="1.0" appid="8136"
idekey="test"><engine version="2.0.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick
Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c)
2002-2008 by Derick Rethans]]></copyright></init>

in the <init> tag line, what is the entry for fileuri ?

do the cases match when you do a dir from your windows system of the file that shoudl be picked up ?

Dave Kelsey




Dave Kelsey wrote:
> Sounds like linked folders could be the issue here.
>
Re: XDebug JIT fails ... somewhere [message #91938 is a reply to message #91346] Sun, 25 January 2009 11:43 Go to previous messageGo to next message
Miha Vrhovnik is currently offline Miha VrhovnikFriend
Messages: 9
Registered: July 2009
Junior Member
It's the same problem I was having previous week. you MUST add project
folder to the include paths for JIT debugging to work. And yes this is
annoying as hell.

Regards,
Miha
Re: XDebug JIT fails ... somewhere [message #91997 is a reply to message #91567] Mon, 26 January 2009 08:19 Go to previous messageGo to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
> So I have tried to recreate your scenario as follows with a simple script

Scenario seems to match exactly ... so tried again - and it works - and i
can't make it fail no matter what (sensible) i try :/ ... wth?

What could have changed:
* no configuration changes in eclipse - at all (related or otherwise).
* no configuration changes at server side or folders.
* created a new local project - did not attempt to debug or anything. busy
with other stuff, did hardly anything with it.
* i did restart my pc ... khm :/ ... quite sure i had not done that a week
or two.

* we did have some network problems, but not at the time nor every day.

* did not notice anything interesting in eclipse .log file.

=> no idea why it is working now. I'm assuming restart did its magic.
Re: XDebug JIT fails ... somewhere [message #92010 is a reply to message #91997] Mon, 26 January 2009 09:06 Go to previous message
Eclipse UserFriend
Originally posted by: dkel50.hotnospmail.com

There is one last possibility, when you start PDT it may not be
listening on port 9000 straight away. But in your scenario I see this as
highly unlikely as the only time this occurs is if the PHP debug plugin
is not loaded (it would be loaded when you open a PHP file, switch to
PHP Debug, or change debug preferences) which in most cases this would
not be the case and it would load. This is fixed in the 2.0.1 builds.

Dave Kelsey


Hell No wrote:
>> So I have tried to recreate your scenario as follows with a simple script
>
> Scenario seems to match exactly ... so tried again - and it works - and
> i can't make it fail no matter what (sensible) i try :/ ... wth?
>
> What could have changed:
> * no configuration changes in eclipse - at all (related or otherwise).
> * no configuration changes at server side or folders.
> * created a new local project - did not attempt to debug or anything.
> busy with other stuff, did hardly anything with it.
> * i did restart my pc ... khm :/ ... quite sure i had not done that a
> week or two.
>
> * we did have some network problems, but not at the time nor every day.
>
> * did not notice anything interesting in eclipse .log file.
>
> => no idea why it is working now. I'm assuming restart did its magic.
>
Previous Topic:Zend PDT All-In-One CRC-check fails
Next Topic:Determine object file from other files
Goto Forum:
  


Current Time: Thu Feb 02 20:55:09 GMT 2023

Powered by FUDForum. Page generated in 0.02315 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top