martomo / SublimeTextXdebug

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

Breakpoints not hit #2

Closed g105b closed 11 years ago

g105b commented 11 years ago

I bet you're sick of hearing from me :)

I have followed your installation instructions for yesterday's update, but nothing I try makes breakpoints get hit. The context and stack windows remain empty, but the following message is displayed in the status bar every time I refresh the page:

image

This is with or without ?XDEBUG_SESSION_START=sublime.xdebug, restarted webserver, double-checked php.ini... I can't think of anything else, please advise.

g105b commented 11 years ago

Since doing a pull, the behaviour has changed, but functionality hasn't got to where it was in ST2 with the original Kindari repo.

Then the outcome is the following:

Can I confirm what settings I should have in Xdebug.sublime-settings ?

I'd love to help you out more on this, as I'm sure it's something very simple todo with my machine's setup.

martomo commented 11 years ago

Some web applications will catch and parse the URI, which contains the ?XDEBUG_SESSION_START, resulting the server not being able to receive it. Try to use browser extensions to send the XDEBUG_SESSION_START through REQUEST, for example Xdebug Helper extension for Chrome

If the script you are trying to debug is on a remote server, use the path_mapping in Xdebug.sublime-settings as shown below.

{
    ...
    "path_mapping": {
        "/path/to/file/on/server" : "/path/to/file/on/computer"
    }
    ...
}

Also I would suggest to check the firewall settings, make sure plugin_host(.exe) has the valid rights for listening to the debugging port and/or no other IDE is also listening to this port.

It is indeed curious that the breakpoint icon turned from grey to gold, without any context/stack data.

I will try to see I can reproduce this issue within a virtual machine running Ubuntu 13.04.

Another solution might be, but this limits Xdebug to only one remote host is to configure your IP address in php.ini:

[xdebug]
zend_extension = /absolute/path/to/your/xdebug-extension.so
xdebug.remote_enable = 1
xdebug.remote_host = "192.168.1.10" ; Set this IP address of the device which is running Sublime Text
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
martomo commented 11 years ago

@g105b I will close this issue, I'm assuming you have resolved the issue, seeing there has been no reply after my last response, also I did not experience any issues when trying to reproduce it on a virtual machine running Ubuntu 13.04.

g105b commented 11 years ago

Actually I thought I'd take a breather, I couldn't work it out - I'll do some more extensive testing on why I couldn't get it to work soon ... maybe I'll record a screencast, or would you find it interesting to remote desktop into my machine yourself?

martomo commented 11 years ago

@g105b I have updated the README with more detail about the configuration.

mxmrlt commented 11 years ago

Hi. I'm afraid I've got the same problem g105b has. I'm on Mac OSX 10.8.4, Sublime Text 3. When I run a remote debug Sublime Text stop on my breakpoint. Breakpoint icon turns from grey to gold and no context or stack. It seems that stepping works because when I step over or into PHP files are opened and screen moves but I don't have any arrow in the gutter at the debug line. Any hint?

mxmrlt commented 11 years ago

So I've just tried debugging with Codebug an OSX XDebug client and everything went well. So there's a problem with the Sublime Text XDebug package. Is there anyone here with OSX 10.8 and ST3 with the same problem? Thank you.

stridera commented 11 years ago

I'm having this same issue if it helps. Codebug works fine with breakpoints. When I access the file that's open, the stack and context windows populate, however, breakpoints stay grayed out.

martomo commented 11 years ago

@stridera What operating system(s) and version of Sublime Text are you using?

Is the script you are trying to debug remotely or locally?

Can you post your project/settings file and Xdebug configuration from the *.ini located on your server.

stridera commented 11 years ago

I'm on OS X v10.8.5 Using the latest stable version of Sublime Text 3. (3047)

I'm hitting a remote server, but I have a reverse tunnel setup for port 9000 so it appears as local.

"settings": {
    "xdebug": { 
        "url": "https://app.mjones.inside-box.net/",
        "debug": true }}

[mjones@mjones.dev ~]$ php -i | grep xdebug 41:/etc/php.d/xdebug.ini, 42:/etc/php.d/xdebug_profiling.ini, 693:xdebug 695:xdebug support => enabled 703:xdebug.auto_trace => Off => Off 704:xdebug.cli_color => 0 => 0 705:xdebug.collect_assignments => Off => Off 706:xdebug.collect_includes => On => On 707:xdebug.collect_params => 0 => 0 708:xdebug.collect_return => Off => Off 709:xdebug.collect_vars => Off => Off 710:xdebug.coverage_enable => On => On 711:xdebug.default_enable => On => On 712:xdebug.dump.COOKIE => no value => no value 713:xdebug.dump.ENV => no value => no value 714:xdebug.dump.FILES => no value => no value 715:xdebug.dump.GET => no value => no value 716:xdebug.dump.POST => no value => no value 717:xdebug.dump.REQUEST => no value => no value 718:xdebug.dump.SERVER => no value => no value 719:xdebug.dump.SESSION => no value => no value 720:xdebug.dump_globals => On => On 721:xdebug.dump_once => On => On 722:xdebug.dump_undefined => Off => Off 723:xdebug.extended_info => On => On 724:xdebug.file_link_format => no value => no value 725:xdebug.idekey => no value => no value 726:xdebug.max_nesting_level => 100 => 100 727:xdebug.overload_var_dump => On => On 728:xdebug.profiler_aggregate => Off => Off 729:xdebug.profiler_append => Off => Off 730:xdebug.profiler_enable => Off => Off 731:xdebug.profiler_enable_trigger => On => On 732:xdebug.profiler_output_dir => /tmp => /tmp 733:xdebug.profiler_output_name => cachegrind.out.%R.%t.mp3 => cachegrind.out.%R.%t.mp3 734:xdebug.remote_autostart => On => On 735:xdebug.remote_connect_back => Off => Off 736:xdebug.remote_cookie_expire_time => 3600 => 3600 737:xdebug.remote_enable => On => On 738:xdebug.remote_handler => dbgp => dbgp 739:xdebug.remote_host => localhost => localhost 740:xdebug.remote_log => no value => no value 741:xdebug.remote_mode => req => req 742:xdebug.remote_port => 9000 => 9000 743:xdebug.scream => Off => Off 744:xdebug.show_exception_trace => Off => Off 745:xdebug.show_local_vars => Off => Off 746:xdebug.show_mem_delta => Off => Off 747:xdebug.trace_enable_trigger => Off => Off 748:xdebug.trace_format => 0 => 0 749:xdebug.trace_options => 0 => 0 750:xdebug.trace_output_dir => /tmp => /tmp 751:xdebug.trace_output_name => trace.%c => trace.%c 752:xdebug.var_display_max_children => 128 => 128 753:xdebug.var_display_max_data => 512 => 512 754:xdebug.var_display_max_depth => 3 => 3

stridera commented 11 years ago

Server: [mjones@mjones.dev ~]$ uname -a Linux mjones.dev 2.6.32-358.18.1.el6.x86_64 #1 SMP Tue Aug 27 14:23:09 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux

martomo commented 11 years ago

@stridera Can you add break_on_start: true, to your settings, so it will stop the script on connect.

Also I'm afraid you forgot to configure the path_mapping, what is the location of the script your are trying to debug on your local OS X and on your remote server?

stridera commented 11 years ago

The directories are exactly the same on remote and local (/dev/www/current/)

Adding break_on_start: true doesn't have it break on start either.

martomo commented 11 years ago

Is the directory on your remote host a symbolic link?

stridera commented 11 years ago

(Edit: I lied! Forgot to restart the tunnel.)

Ok, that fixed it. Breakpoints are working! Awesome. Might want to mention that symlinks break it. Thanks though!

Rudis1261 commented 9 years ago

Mine wasn't working either, the mapping really sorted everything out. I am running a little VM with a different file structure to my pc.

mjquito commented 9 years ago

I need help, everything is working fine except my breakpoints. The xdebug_content and stack are showing the stuff, but when I debug a file, i can't see which break-point is being debugged. This problem is similar to @stridera. My sublime is on a windows 7, the server (LAMP) is localhost.

{ "folders": [ { "path": "\ubuntu\local.martinquito.mjquito.com" } ], "settings": { "xdebug": { "path_mapping": { "/opt/bitnami/apache2/htdocs/" : "\ubuntu\local.martinquito.mjquito.com" }, "port": 9000, } } }

ramanacv commented 9 years ago

Hi Martomo I am using sublime3 and its built in xdebug plugin. The zf2 application code stepping happens only in the initial bootstrapping module but doesnt stop in controllers. Any reason why this could be ? I also see client connection timeout errors in xdebug-debug.log file thanks

ramanacv commented 9 years ago

{ "folders": [ { "path": "C:\xampp\htdocs\myrpoj", "follow_symlinks" : true, } ],

"settings" : 
    {
         "xdebug": 
         {

            "path_mapping" :  { "C:\\xampp\\htdocs\\myproj" : "D:\\work\\projects\\myproj" },
        "url" : "http://myproj.localhost/",
        "super_globals": true,
        "close_on_stop": true
        }
    }

}

rogerywoo commented 7 years ago

I was having the same problem. The application was breaking in the breakpoint, but the little yellow arrow as not being displayed. After working on it for several hours, Martomo comment on path_mapping gave me an idea. The path mapping is CASE SENSITIVE. I had /home/vagrant/PhpProject/. The folder in the virtualbox was phpproject.