View Issue Details

IDProjectCategoryView StatusLast Update
0001702XdebugRemote Debuggingpublic2019-10-07 15:04
ReporterdinuAssigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status newResolutionopen 
Product Version 
Target Version3.0.0devFixed in Version 
Summary0001702: External file path mapping function for debug
DescriptionThis 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.0.0dev
2019-10-07 15:04 derick Severity minor => feature
2019-10-07 15:04 derick Category Feature/Change request => Remote Debugging