View Issue Details

IDProjectCategoryView StatusLast Update
0001937XdebugStep Debuggingpublic2021-02-18 12:12
Reporterdinu Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version3.0.2 
Summary0001937: 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.

TagsNo tags attached.
Operating System
PHP Version7.2.20-7.2.29

Activities

derick

2021-02-18 12:12

administrator   ~0005682

"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.

Issue History

Date Modified Username Field Change
2021-01-22 10:13 dinu New Issue
2021-02-18 12:12 derick Assigned To => derick
2021-02-18 12:12 derick Status new => resolved
2021-02-18 12:12 derick Resolution open => no change required
2021-02-18 12:12 derick Note Added: 0005682