View Issue Details

IDProjectCategoryView StatusLast Update
0001702XdebugStep Debuggingpublic2023-11-03 11:16
Reporterdinu Assigned To 
PrioritylowSeverityfeatureReproducibilityhave not tried
Status acknowledgedResolutionopen 
Target Version3.4dev 
Summary0001702: External file path mapping function for debug
Description

This is a recurrent problem that I noticed in a few projects and I got to thinking about it and a resolution.
Projects sometimes use caching and maybe sometimes a form of subtle patching (especially to class definitions names) for class definition files.
But then, in order to enable Xdebug to work on the original source files, they use some form of stream-wrapping (either namespace://path-to-file with stream_register_wrapper, or php://filter=someFilter/resource=... with stream_filter_register). Both methods get passed paths to the original source file but return the content of the cached/patched file.
While this does work for Xdebug, it breaks other things (such as the opcache) and it's fixing a problem where it's not.
The problem to solve is "how can I tell the debugger that the code in <cached_file> is the same (line numbers at least) with <source_file> and when debugging, I will actually be debugging <source_file>". Formally, this would be best resolved at GUI-level of course, but that's not likely to happen.
So I was thinking if it would be difficult or a bad idea to devise some form of mapping in Xdebug to map the cache files to the source files.

To make it clear formally, it would be a two-way hash in the form of:
<source-path> <-> <cached-path>
Where Xdebug will follow these 2 rules:
1) Breakpoints on <source-path> also apply to <cached-path>
2) During debug, <cached-path> steps (code points) should be reported as <source-path> back to the GUI

TagsNo tags attached.
Operating System
PHP Version7.3.5-7.3.9

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-09-14 14:27 dinu New Issue
2019-10-07 15:04 derick Target Version => 3.0dev
2019-10-07 15:04 derick Severity minor => feature
2019-10-07 15:04 derick Category Feature/Change request => Remote Debugging
2020-03-12 16:33 derick Category Remote Debugging => Step Debugging
2020-11-18 15:33 derick Target Version 3.0dev => 3.1dev
2021-06-20 13:42 derick Target Version 3.1dev => 3.2dev
2021-08-06 17:36 derick Priority normal => low
2021-08-07 10:03 derick Status new => acknowledged
2022-06-06 15:27 derick Target Version 3.2dev => 3.3dev
2023-11-03 11:16 derick Target Version 3.3dev => 3.4dev