SublimeXdebug icon indicating copy to clipboard operation
SublimeXdebug copied to clipboard

Breakpoints work, status is "break" but "Stack" and "Context" tabs missing

Open nathanjovin opened this issue 12 years ago • 2 comments

I was able to modify the uri() function to get remote paths correct, and the server is connecting back to ST2. However, I have two panes in ST2 where the Stack and Context should be, but there are no tabs and no info displayed. Steps to reproduce:

  1. Open ST2
  2. Open file on remote server
  3. Set breakpoint in file
  4. Start debugging, at which point xdebug logs the following on the server:
<- breakpoint_set -i 1 -n 3 -t line -f file:///var/www/html/myscript.php
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug"     command="breakpoint_set" transaction_id="1" id="24620002"></response>

<- run -i 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug"  command="run" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file:///var/www/html/myscript.php" lineno="3"></xdebug:message></response>

If I fire off a status command from the plugin, the server logs:

<- status -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="3" status="break" reason="ok"></response>

So xdebug is connected, and is breaking, but is not requesting/receiving info from xdebug

nathanjovin avatar Nov 15 '12 15:11 nathanjovin

Checked the console and was getting "AttributeError: 'NoneType' object has no attribute 'encode'" on line 469 of Xdebug.py.

I did some troubleshooting and found that the plugin was attempting to fire the Sublime view with the remote path (due to my update uri() function). I hardcoded the local path in and got it to work.

This local/remote stuff makes the plugin completely unusable for remote dev if your paths and operating systems aren't the same.

I'm not a python guru, but it seems that there'd be some way to allow for this in the configuration. I might play around with it a bit later on.

nathanjovin avatar Nov 15 '12 15:11 nathanjovin

@nathanjovin to address the local/remote issue i patched some lines in "def callback(self, state)"

        if child.nodeName == 'xdebug:message':
            remote_path = child.getAttribute('filename')
            local_path = remote_path.replace( "///", "///your/local/prefix/" )
            sublime.status_message('Xdebug: breakpoint')
            xdebug_current = show_file(self.view.window(), local_path)
            xdebug_current.current(int(child.getAttribute('lineno')))

sir-oliver avatar Jan 15 '13 18:01 sir-oliver