|XDebug JIT and duplicate files [message #651106]
||Thu, 27 January 2011 14:08
| Brendan Dunn
Registered: January 2011
Odd bit of behavior here.|
I am working on a large project, which is a mixture of C/C++ applications and libraries, and PHP pages. My Eclipse environment has both the CDT and PDT installed (Helios). Consider the structure to be the following:
main - Contains the entire project - sub-folders for each library and application, as well as the web folder. Also contains the main Makefile.
www - Sub-directory of main. Contains all PHP files.
So, when I put this all into eclipse, I end up creating two separate projects in the workspace. Project 1 is a C/C++ Makefile Project, based off of the main folder. Project 2 is a PHP Project, based off the www sub-folder. Though both projects are using the same source tree and same files (created using existing source), the workspace sees each folder under the www tree twice - once in each project.
So, the problem - I'm debugging the PHP portion using XDebug JIT. Everything seems to work fine connection-wise; I can set a breakpoint in one of the files under the www project, and if I hit it with a browser with the XDebug cookies set, Eclipse catches the breakpoint. At this point, though, it opens the file in the *main* project for debugging.
I can't just work with the main project, as PDT requires me to both have the www PHP project, and to put the breakpoints in there directly. Basically:
1. I put a breakpoint in /www/test.php, it will get hit - but the debugger will open /main/www/test.php
2. If I put a breakpoint in /main/www/test.php, it will not get hit.
3. If I eliminate the www PHP project entirely and set a breakpoint, it will throw errors.
This means that during debugging, I end up with each file open twice, which is potential for confusion/error (changes in one won't immediately reflect in the other, even though the underlying filesystem file is the same). Since it's JIT debugging, the settings in the Debug Configurations don't apply to the breakpoints - it seems to just pick the first instance of the file it finds in the workspace (alphabetically by project - my current brute-force workaround is to make sure the www project is named to come first in the workspace).
Is there any more elegant way to tell it to only focus on the PHP project(s) in the workspace when it hits an XDebug breakpoint?
[Updated on: Thu, 27 January 2011 14:35]
Report message to a moderator
|Re: XDebug JIT and duplicate files [message #651168 is a reply to message #651106]
||Fri, 28 January 2011 02:09
| Toshihiro Izumi
Registered: July 2009
Could you please submit a bug report to bugzilla?|
>it seems to just pick the first instance of the file it finds in the workspace.
Exactly. PDT searches the file in the workspace and picks the first one whether it is in the php project or not, whether the project is opened or closed...
(Xdebug sends full-path of the script to PDT.
PDT remaps it according to path-mapping and resolves it to full-path.
PDT searches the file in the workspace with full-path.
Even if several files are found, PDT always picks first file since there is no info about 'project'.
Same problem occurs with linked resources.)
Powered by FUDForum
. Page generated in 0.01581 seconds