Request for funding: XDebug support for Flow and Neos

Hey Kay,

Unfortunately the badges have to be generated manually. I will send you yours by e-mail! Sorry for the delay!

Ok, cool - and thank you.

Derick started working on the implementation of our requested feature and will publish a report each month about the progress of his work.

You find the first of those reports on his website:
https://xdebug.org/funding/001-native-path-mapping/updates/2024-08-05

4 Likes

Derick published his second report regarding this project:
https://xdebug.org/funding/001-native-path-mapping/updates/2024-09-02

5 Likes

Derick published another report regarding this new feature:
https://xdebug.org/funding/001-native-path-mapping/updates/2024-11-01

6 Likes

Do you know an estimated/ plan when this should
be ready for production? Thanks and also big kudos to Derick :pray:

3 Likes

The latest update by Derick: Xdebug - November and December: Relative and Reverse Mappings

But no ETA, so far…

1 Like

Derick has posted an update 2025-05-13 January through May: Finishing the Initial Preview and the code is available in xdebug/xdebug and his personal fork derickr/xdebug.

I’m wondering myself. Has anyone tested the current development version in Flow so far? And are there plans to implement “Native Path Mapping” in Flow? I couldn’t find an issue or pull request on GitHub so far?

Just tested the code. It works on my machine :wink:

As this discussion here is about founding, I opened an issue on GitHub (FEATURE: Support Xdebug Native Path Mapping · Issue #3480 · neos/flow-development-collection · GitHub) to share and discuss implementation in Flow.

7 Likes

Awesome, thanks for testing and creating the issue!

Dereks Teaser Video made me wonder: Would it be possible to debug Fusion code even? :exploding_head:

1 Like

There is another update:

The first version of the native path mapping in xdebug has been released recently.

1 Like

Here’s an email Derick sent regarding the current progress:

Fabian Potencier, from Symfony fame, has created an exploratory patch[1]
for Twig to make use of Xdebug’s new Native Path Mapping functionality.

[1] https://github.com/twigphp/Twig/pull/4733

From the initial patch, it became clear that a few things need to be
improved on the Xdebug side for this to be a complete feature. For that
reason, I have created a few issues to work on:

  • Invent better way of configuring lots of line-to-line mappings

Right now, each line mapping needs to have a special line, resulting in
mapping file that look like:

user-info-823edfe12e38a649355c5172b9d98e0a.php:2-31 = user-info.ezt:1
user-info-823edfe12e38a649355c5172b9d98e0a.php:32-33 = user-info.ezt:2
user-info-823edfe12e38a649355c5172b9d98e0a.php:34-36 = user-info.ezt:3
user-info-823edfe12e38a649355c5172b9d98e0a.php:37 = user-info.ezt:4
user-info-823edfe12e38a649355c5172b9d98e0a.php:38 = user-info.ezt:5
user-info-823edfe12e38a649355c5172b9d98e0a.php:39-40 = user-info.ezt:6
user-info-823edfe12e38a649355c5172b9d98e0a.php:41-46 = user-info.ezt:7

user-info-823edfe12e38a649355c5172b9d98e0a.php:301-302 = user-info.ezt:73
user-info-823edfe12e38a649355c5172b9d98e0a.php:303 = user-info.ezt:74-75
user-info-823edfe12e38a649355c5172b9d98e0a.php:304-306 = user-info.ezt:76

This is really ineffecient, so I will be looking at a way to collapse
these all in one line.

  • Create xdebug_add_source_map_directory() function

Right now, Xdebug will check for path mapping files only in some parent
.xdebug/ directories. As Twig, and likely other tools, would want to
generate their own files into their own cache directory, it is needed
that tools can specify these extra directories.

  • Add EOF marker/stanza to native path file mapper

The Twig mapping generator is using 999999 to denote the end of a line
range, to mean “end of file”. It would be better that Xdebug implements
a specific keyword (think EOF) for this instead so that now arbitrary
numbers have to be used.

I am hoping to work on these features in the next few months to land in
Xdebug 3.6, which I am planning to release in the middle of this year.

Additionally, my PhpStorm issue to allow for the setting of breakpoints
in template file has now been merged, and is scheduled for 2026.1 EAP 2.
At the time of writing this isn’t quite out yet, so I will keep you
posted.

2 Likes