Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338090

Summary: XDebug breakpoints may resolve to files in a non-PDT project
Product: z_Archived Reporter: Brendan Dunn <eclipse>
Component: PDTAssignee: PHP Debug <php.debug-inbox>
Status: NEW --- QA Contact:
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Brendan Dunn CLA 2011-02-24 09:35:28 EST
Build Identifier: 20100917-0705

If two projects in a workspace share part of a common code-base containing PHP files, and a breakpoint is placed in one of these files, the debugger will resolve the breakpoint to the file in whichever project comes first alphabetically.  This will occur even if the first alphabetical project is a non-PDT project.

The breakpoints are still required to be set within a PDT project.  This means that each file will be opened twice for debugging - once by the developer when setting the breakpoint, and a second instance in the alternate project opened by the debugger.

Workaround - ensure PDT projects in the shared code-base are named alphabetically before non-PDT projects within the workspace.

Reproducible: Always

Steps to Reproduce:
Prerequisite - Eclipse environment with both CDT and PDT.  Webserver with PHP, and XDebug.  XDebug configured within eclipse. 
1. Create a new 'Hello World' C++ project called 'testphp'.  Instead of the default, create it in a location outside the workspace.
2. Create a sub-folder called 'www'.  Add a PHP file to the www folder called 'index.php'.  Give it at least one line that can support a breakpoint.
3. Create a new PHP project called 'www'.  Create at existing location, and choose the 'www' folder from the original project.
4. Deploy the index.php file to your webserver.  Create a breakpoint in 'workspace/www/index.php', and load the page.  The debugger will hit the breakpoint, but will open 'workspace/phptest/src/www/index.php'.
5. Remove the breakpoint from 'workspace/www/index.php', and place it in 'workspace/phptest/src/www/index.php'.  Load the page.  The breakpoint will not be hit.
6. (Optional) Repeat steps 3-5, but this time, call the project 'aaa-www'.  Since alphabetically, this occurs first in the workspace, XDebug will resolve PHP breakpoints to the file within the 'aaa-www' project.