martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

UNC paths not handled properly (breaks breakpoint icons) #118

Open jmm opened 9 years ago

jmm commented 9 years ago

SublimeTextXdebug doesn't properly handle UNC paths. E.g. \\ComputerName\SharedFolder\Resource.

If you setup remote debugging with path mapping from the server path to a UNC path, SublimeTextXdebug pauses at breakpoints, but it doesn't change the icon for the breakpoint (it remains solid gray). It's because the filename stored in S.BREAKPOINT_ROW in xdebug/session.py has been altered by get_real_path() and then in xdebug/view.py it's compared to view.file_name().

For example, I have Sublime Text running in Windows 7 and PHP / xdebug running on a physical Ubuntu server on the same local network. I'm editing files on the Ubuntu server in Sublime Text via Samba. So I have something like this:

"path_mapping" : { "/some/dir" : "\\\\example.\\share\\some\\dir" }

Basically what's happening is SublimeTextXdebug is converting my UNC path to //example./share/some/dir in S.BREAKPOINT_ROW then comparing it to the original value.

A pull request that resolves that issue is on its way. Please take a look and see if you think it would cause any unwanted side effects.