View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001964 | Xdebug | Step Debugging | public | 2021-04-11 18:52 | 2024-08-12 13:58 |
Reporter | Zobo | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | feedback | Resolution | open | ||
Platform | Windows | OS | Windows | OS Version | 10 |
Product Version | 3.0.4 | ||||
Target Version | 3.4dev | ||||
Summary | 0001964: WSL UNC paths don't have needed prefix | ||||
Description | I just ran into an issue where Xdebug is presenting a UNC path in such way I cannot map it back to original. I executed a script from an UNC path \WSL$\UBUNTU\home\zobo\php\test1.php Looking at phpinfo() output, php is OK with it:
However Xdebug presents the files as:
Also true for stack:
I am not sure if this is true in case of network mapped UNC paths, but I have a strong suspicion it is. See: https://github.com/xdebug/vscode-php-debug/issues/546 In case it's a normal "windows path" the url becomes Was this already encountered? | ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 8.0.0-8.0.4 | ||||
|
I read this https://en.wikipedia.org/wiki/File_URI_scheme and am considering this os actually correct... |
|
Upon further debugging I did find other strange things: First the case is strange: If I try to set a breakpoint: [50420] [Step Debug] <- breakpoint_list -i 3 It's treated as relative path... This should not be valid in URL context. So in case of windows UNCs I think the syntax should really be encoded as file:////host/path.... I guess this is a far more complex issue than I hoped for... However not being able to set a breakpoint for a UNC path is IMO a bug. |
|
Xdebug handles UNC paths, and prefixes them with file:// : https://github.com/xdebug/xdebug/blob/master/src/lib/usefulstuff.c#L310-L313 This is an implementation of a specification on the MSFT website: https://docs.microsoft.com/en-us/archive/blogs/ie/file-uris-in-windows Which says:
And this is exactly what Xdebug does. So I also don't think there is a bug here. |
|
I still don't know what to do here... either break "Proper Syntax" that Windows and Wikipedia explain, or ignore it and suggest people mount their drive with a drive letter. |
|
While "WSL$" has correct casing, I wonder, what was the correct casing for "Ubuntu"? As for PHP's output, it uses what was passed to it. |
|
Hi derick, the problem is that a unc path is requested and at a single point in log file this address is interpreted as local windows file path. requested: file://139.138.58.141/phpinfo.php log_7_4_30_own.txt (6,941 bytes)
[4356] Log opened at 2022-07-19 12:10:32.012137 [4356] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [4356] [Step Debug] INFO: Checking remote connect back address. [4356] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'. [4356] [Step Debug] INFO: Checking header 'REMOTE_ADDR'. [4356] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 034c:2284:6de2:e1c3:3ac2:e4bf:c065:a287:9003. [4356] [Step Debug] INFO: Connected to debugging client: 034c:2284:6de2:e1c3:3ac2:e4bf:c065:a287:9003 (from REMOTE_ADDR HTTP header). :-) [4356] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file://139.138.58.141/phpinfo.php" language="PHP" xdebug:language_version="7.4.30" protocol_version="1.0" appid="4356" idekey="PHPSTORM"><engine version="3.1.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2022 by Derick Rethans]]></copyright></init> [4356] [Step Debug] <- feature_set -i 1 -n show_hidden -v 1 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response> [4356] [Step Debug] <- feature_set -i 2 -n max_depth -v 1 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response> [4356] [Step Debug] <- feature_set -i 3 -n max_children -v 100 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response> [4356] [Step Debug] <- feature_set -i 4 -n extended_properties -v 1 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response> [4356] [Step Debug] <- feature_set -i 5 -n notify_ok -v 1 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response> [4356] [Step Debug] <- stdout -i 6 -c 1 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="6" success="1"></response> [4356] [Step Debug] <- status -i 7 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="7" status="starting" reason="ok"></response> [4356] [Step Debug] <- step_into -i 8 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file://139.138.58.141/phpinfo.php" lineno="2"></xdebug:message></response> [4356] [Step Debug] <- eval -i 9 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="9"><property type="bool"><![CDATA[0]]></property></response> [4356] [Step Debug] <- eval -i 10 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="10"><property type="bool"><![CDATA[1]]></property></response> [4356] [Step Debug] <- eval -i 11 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="11"><property type="string" size="36" encoding="base64"><![CDATA[bmljb3BpZXRzY2guZGV2ZWxvcGVycy55ZWxsb3dmb3gubmV0]]></property></response> [4356] [Step Debug] <- eval -i 12 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10p [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="12"><property type="string" size="3" encoding="base64"><![CDATA[NDQz]]></property></response> [4356] [Step Debug] <- eval -i 13 -- KHN0cmluZykoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10p [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"><property type="string" size="20" encoding="base64"><![CDATA[L2hhdmFyaWUvcGhwaW5mby5waHA=]]></property></response> [4356] [Step Debug] <- breakpoint_set -i 14 -t line -f file:///139.138.58.141/phpinfo.php -n 8 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="14" id="43560001"></response> [4356] [Step Debug] <- stack_get -i 15 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="15"><stack where="{main}" level="0" type="file" filename="file://139.138.58.141/phpinfo.php" lineno="2"></stack></response> [4356] [Step Debug] <- run -i 16 [4356] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[WC1Qb3dlcmVkLUJ5OiBQSFAvNy40LjMw]]></stream> [4356] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream> [4356] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q29udGVudC10eXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTg=]]></stream> [4356] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream> [4356] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream> [4356] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[PCFET0NUWV...0bWw+]]></stream> [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="16" status="stopping" reason="ok"></response> [4356] [Step Debug] <- detach -i 17 [4356] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="17" status="stopping" reason="ok"></response> [4356] Log closed at 2022-07-19 12:10:32.246517 |
|
Hi all. Cannot find file ‘/home/svante/projects/myproject/bin/cli.php’ locally In the xdebug log I get entries like: [11181] [Step Debug] <- breakpoint_set -i 15 -t line -f file:////wsl.localhost/Ubuntu/home/svante/projects/myproject/bin/cli.php -n 10 I tried mapping wsl to w:\, which makes little difference. [1543] [Step Debug] <- breakpoint_set -i 15 -t line -f file://W:/home/svante/projects/myproject/bin/cli.php -n 15 I see that you have a "target version" to solve this problem that is set to 3.4dev, but I guess this just is default for "next version", or something like that. |
|
An extra note. In the above I focused on cli. In fpm it actually works, mapped to w:\ or not, until I press F9 (resume program). |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-04-11 18:52 | Zobo | New Issue | |
2021-04-12 20:09 | Zobo | Note Added: 0005825 | |
2021-04-14 08:36 | Zobo | Note Added: 0005826 | |
2021-04-16 16:17 | derick | Assigned To | => derick |
2021-04-16 16:17 | derick | Status | new => feedback |
2021-04-16 16:18 | derick | Note Added: 0005851 | |
2021-04-16 16:18 | derick | Note Edited: 0005851 | |
2021-05-14 15:31 | derick | Target Version | => 3.1dev |
2021-05-21 13:20 | derick | Relationship added | has duplicate 0001939 |
2021-08-07 10:10 | derick | Note Added: 0005968 | |
2021-08-27 17:38 | AnrDaemon | Note Added: 0005995 | |
2021-09-01 15:33 | derick | Target Version | 3.1dev => 3.2dev |
2022-06-06 15:27 | derick | Target Version | 3.2dev => 3.3dev |
2022-07-19 12:15 | dwade3 | Note Added: 0006348 | |
2022-07-19 12:15 | dwade3 | File Added: log_7_4_30_own.txt | |
2023-08-02 16:45 | derick | Target Version | 3.3dev => 3.4dev |
2024-08-12 11:32 | Svante | Note Added: 0007045 | |
2024-08-12 13:58 | Svante | Note Added: 0007046 |