View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001937||Xdebug||Step Debugging||public||2021-01-22 10:13||2021-02-18 12:12|
|Status||resolved||Resolution||no change required|
|Summary||0001937: Wrong mapping of symlinked files|
|Description||A situation that occurs commonly when i.e. developing composer libraries is that we use "path" type repositories for composer. |
What this does is set composer to symlink the library source files into the project rather than downloading a copy from the VCS.
Let's say I have vendor/lib symlinked to /some/other/path/lib
What happens with Xdebug when this is the case:
1) The breakpoints are correctly working on the symlinked file: when I set breakpoints in vendor/lib/x.php I have the proper xdebug break
2) However, the source file reference is in the symlinked file: I will get a step frame in /some/other/path/lib/x.php
This means I have to include /some/other/path/lib/ in my project for my GUI to pick up the debugged sources. However, this causes confusion and chaos in the development process.
What would be needed is that the symlink is not dereferenced when stepping.
|Tags||No tags attached.|
"What would be needed is that the symlink is not dereferenced when stepping."
That's not possible.
Xdebug only sees the physical absolute path, because that is the only information that PHP provides to it. It can't see the symlink's "link name" at all.
If you want to work with symlinked files, you need to set up path mappings in your IDE, similar to mapping remote file paths to local ones.
You should not have to add "/some/other/path/lib/" to your project for this.