kindari / sublimexdebug Goto Github PK
View Code? Open in Web Editor NEWXdebug Interface for Sublime Text 2
License: Other
Xdebug Interface for Sublime Text 2
License: Other
When I start debugging on any php file within my project, the browser launches with the correct url and
?XDEBUG_SESSION_START=sublime.xdebug
But in Sublime Text 2 the tabs that appear for Xdebug Context and Xdebug Stack are empty
I have put some breakpoints in but the code does not stop at them.
At the bottom of sublime I get the following message:
Xdebug: Page finished executing. Reload to continue debugging
What should I reload, the page in the browser? should this include the query string? I tried that but nothing happens.
I am on a mac using mamp with php 5.3.6
I have my sites mapped using vhosts
I have xdebug installed and these are my php.ini settings
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
;Typical xdebug port
xdebug.remote_port=9000
xdebug.remote_autostart=off
;You might need to increase the limit, this is set to 400 but you can change it.
xdebug.max_nesting_level = 400
xdebug.remote_mode=req
xdebug.default_enable=1
;Helps identify the correct xdebug application
xdebug.idekey=sublime.xdebug
; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32
; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32
Please can someone help me identify what I am doing wrong?
Thanks
This plugin looks like it could be really useful to a lot of developers. I short readme with the basics of how to use it would be nice.
Hello,
I've an issue with the plugin, everytime I try to start debugging It seems to work, layouts open but don't show anything.
When I reload my browser I can see in ST status "Page finished executing, reload to continue debugging" and nothing happens.
Here's my log of Xdebug :
I: Checking remote connect back address.
I: Remote address found, connecting to 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Stacks/MAMP5.4.3/apps/bloom/Public/index.php" language="PHP" protocol_version="1.0" appid="15139" idekey="sublime.xdebug"><engine version="2.3.0dev"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init>
<- run -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="1" status="stopping" reason="ok"></response>
I've tried to test Xdebug with MacGDBP and it seems to work, I've also tried to run a "netstat -an | egrep 'Proto|LISTEN'" in Terminal and I get :
tcp4 0 0 *.9000 *.* LISTEN
Do you have an idea of what's going on ? I don't really know what to do to make it work with ST2 :(
Thanks in advance,
Antoine
Hi,
I've got this error when I try to do a debug.
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "./Xdebug.py", line 248, in thread_callback
File "./Xdebug.py", line 119, in accept
AttributeError: 'NoneType' object has no attribute 'settimeout'
When trying to configure sublime with the settings in the readme, Sublime complains about trailing comma.
I downloaded python2.6_2.6.5-1ubuntu6_i386.deb
, extracted it, and copied usr/lib/python2.6
folder to {Sublime Text directory}/lib
(I also removed original python26.zip
file from the lib folder).
But apparently sublime can't work with that python, because I'm constantly getting errors in the console like this one
AttributeError: 'module' object has no attribute 'on_activated'
With original python I was getting this exception:
Exception in thread Thread-11:
Traceback (most recent call last):
File ".\threading.py", line 532, in __bootstrap_inner
File ".\threading.py", line 484, in run
File "./Xdebug.py", line 321, in thread_callback
File "./Xdebug.py", line 137, in accept
ProtocolConnectionException
Looking for any help on this.
xdebug.var_display_max_depth=4
Not sure if I'm missing something but when I select an object in sublime with the debugger running this is what I see
$shorturl (object) =
$shorturl->message (string) = http://www.google.com/ added to database
$shorturl->shorturl (string) = http://s.aaa/1q
$shorturl->status (string) = success
$shorturl->statusCode (int) = 200
$shorturl->title (string) = Google
$shorturl->url (object) =
When I var_dump the same variable I get the following:
object(stdClass)[24]
public 'url' =>
object(stdClass)[25]
public 'keyword' => string '1p' (length=2)
public 'url' => string 'http://www.google.com/' (length=22)
public 'title' => string 'Google' (length=6)
public 'date' => string '2012-07-12 17:31:00' (length=19)
public 'ip' => string '127.0.0.1' (length=9)
public 'status' => string 'success' (length=7)
public 'message' => string 'http://www.google.com/ added to database' (length=40)
public 'title' => string 'Google' (length=6)
public 'shorturl' => string 'http://s.aaa/1p' (length=15)
public 'statusCode' => int 200
Just trying to figure out how to see the entire object.
The Plugin is beautiful it works perfect but when i press Run it freezes Sublime... i use easyxdebug on firefox with it. Any thoughts?
We can now change the port. But the documentation still say
"The debugger assumes XDebug is configured to connect on port 9000"
This should be udpated
I'm getting the status message "Xdebug: No URL defined in project settings file." but my URL is defined in my project settings file. Here's what my whole file looks like:
{
"folders":
[
{
"path": "/Users/John/Work/companyname/working-copy"
}
],
"settings":
{
"xdebug": { "url": "http://companyname.local" }
}
}
I've also tried using the .sublime-project file that looks like this:
{
"folders":
[
{
"path": "/Users/John/Work/companyname/working-copy"
}
],
"xdebug": { "url": "http://companyname.local" }
}
The .subime-project file resides in the directory /Users/John/Work/companyname/working-copy/nbproject (I'm converting from NetBeans).
This is all on OS X 10.7.
I have python 2.6.6 and Sublime Text 2.0.1 Build 2217 on a Linux amd64 system.
The starting of debugging works fine, it launches chrome just fine, etc. But it won't finish drawing the debug windows so I can't tell it to continue playing when it gets to a breakpoint or see what the variables/output is.
I am at a lost on what to check next, any ideas?
I'd love to use this package with Sublime Text 3, but the packages are revamped and would need a bit of work to update
Please, put the option to configure the browser.
thanks
i dont see documentation how to configure a new IP because i want to debug an application thats on a dedicated server. It seems to connect to 127.0.0.1 only?
Any planned Sublime Text 3 versions?
I'm missing something here. I am running Sublime Text 2 and the debugger on my Mac locally with my local set of code for adding breakpoints. I open the page in the browser remotely on a dev server. For some reason, my dev server wants to force the xdebug.keyid to "root", but it seems to be communicating with the debugger just fine. Quality time with Google tells me that it may be looking for (and not finding) some file, but what?
When I start the debugger and refresh my page, I get the following:
Traceback (most recent call last):
File "./Xdebug.py", line 332, in gui_callback
File "./Xdebug.py", line 209, in breakpoint_init
File "./Xdebug.py", line 222, in uri
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 357, in realpath
if isabs(filename):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 52, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
I have a breakpoint set in my unit tests and I've started debugging in Sublime. When I run the tests I get the following error:
94846 segmentation fault phpunit -c tests/phpunit.xml tests
and I have to force stop Sublime as it stops responding.
The stack trace produced by force quitting is here: https://gist.github.com/22bc50d0575d714320dd
If you need any more info, just let me know as I can reproduce this every time.
Hi !
I have an issue with the plugin. When starting debugging a firefox window is opened with ?XDEBUG_SESSION_START=sublime.xdebug but the page doesn't load. Firefox keep trying to reach localhost.
If I run
netstat -l | grep 9000
I can see that connection is established.
tcp 0 0 127.0.0.1:9000 127.0.0.1:44043 ESTABLISHED
tcp 0 0 127.0.0.1:44043 127.0.0.1:9000 ESTABLISHED
Did I miss something somewhere or is it really an issue with the plugin ?
I run my server on a virtual machine, and share the code directories from my host to the VM. The result is that the path to the files from the server's point of view start like this:
/media/sf_code/application/....
And on my host machine are like this:
/home/pete/projects/application/....
IDEs such as Netbeans, Eclipse and PHPStorm allow the user to setup path mappings between a server and the debug client, which enabled debugging in this context.
Is there any possibility of adding this to SublimeXdebug?
This line: $this->promotions_helper->promotion->rs_auto[0]
When I click in $this
, xdebug return this:
$this (object) =
$this->QTYcheck_promotion (object) =
$this->check_num (string) = 349132
$this->check_promotion (object) =
$this->final_date (null) =
$this->inicial_date (null) =
$this->message (null) =
$this->orders_drinks_can (object) =
$this->orders_drinks_have (object) =
$this->orders_foods_can (object) =
$this->orders_foods_have (object) =
$this->promo_num (string) = 21
$this->promotions_helper (object) =
$this->split_num (int) = 0
When I click in promotions_helper, promotions, etc... returns nothing.
My problem is: I want see, what is inside promotions_helper and promotion... but this Plugin show just the 'first layer'.
When I try to start debugging with SublimeXdebug I get the following error in the console:
Exception in thread Thread-102:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "./Xdebug.py", line 281, in thread_callback
File "./Xdebug.py", line 136, in accept
RuntimeError: Must call on main thread, consider using sublime.set_timeout(function, timeout)
And, it seems that SublimeXDebug doesn't end up listening for an Xdebug connection, even when I start one manually by adding XDEBUG_SESSION_START=sublime.xdebug to my project's URL, I get no reaction in SublimeXDebug, (although it seems to think it's debugging, as I have the option to stop debugging in the command palette).
I'm getting this error in the console when the xdebug connection is stablished:
Traceback (most recent call last):
File "./Xdebug.py", line 273, in gui_callback
init = protocol.read().firstChild
File "./Xdebug.py", line 78, in read
document = parseString(data)
File ".\xml\dom\minidom.py", line 1927, in parseString
File ".\xml\dom\expatbuilder.py", line 32, in <module>
File ".\xml\parsers\expat.py", line 4, in <module>
ImportError: No module named pyexpat
how to return it back? i tried everything, restarting sublime, shortcut keys, reinstalling plugin.... ALT SHIFT 1 etc..
The breakpoints I have set from my host operating system's Sublime does not break for code executing on a shared file system from PHP within the guest operating system because the file system paths xdebug is sending is in the form of /var/www/somewhere/index.php and the path that Sublime is familiar with in the host OS is in the form of C:\Users\bran\sites\index.php.
Is this a configurational issue or a feature missing from SublimeXdebug?
It will be a nice addition if you can jump to the function/files from the calling stack itself, is it possible?
I noticed there are OSX key bindings, but none for Windows or Linux. It would be nice if there were some.
Well I wanted to let you all know I'm currently rewriting this. When I first wrote this I wasn't that familiar with the Sublime API or the Xdebug protocol itself. There are a lot of bugs, and a lot of bad architecture. I started trying to implement some of these other feature requests and just found the current layout too much of a pain to use.
I will be pushing soon on a "rewrite" branch. Some things that are already implemented:
In progress:
Todo:
Future (hopes)
Testing:
When I do push this code, it will not be on the master branch for a while. This is a complete rewrite. I will need help testing on all platforms, but especially windows and linux.
If you use a specific feature I did not mention here, please reply so I can make sure we aren't losing features.
I would love to have a setting for configuring the xdebug port. I'm not running on 9000 and don't really have the option to change it.
Is there a way to close the panel where the debugging output is placed?
I'm using Sublime text 2.0.1 on OSX Mountain Lion and when I'm editing PHP files with a .inc extension, none of the xdebug options appear for me to select.
Is there somewhere in the code that limits the plugin to .php files?
Hello! Awesome plugin, this could be really useful if it showed me the current stack =)
Here's a trace:
Traceback (most recent call last):
File ".\sublime_plugin.py", line 356, in run_
File ".\Xdebug.py", line 401, in run
File ".\Xdebug.py", line 420, in callback
AttributeError: 'NoneType' object has no attribute 'current'
....later....
Traceback (most recent call last):
File ".\Xdebug.py", line 420, in callback
AttributeError: 'NoneType' object has no attribute 'current'
Things still work, such as setting a breakpoint, 'running' after that breakpoint up until another breakpoint..just can't see the current stack =)
When the file path on the host machine differs to the local machine, the system will be unable to find the file. This is a common situation when using a VM.
An option is needed to map remote paths to local paths.
For example:
/var/www/someproject
-> X:\someproject
Hi, thanks for the addon, it's a great help!
One annoyance atm is that it opens the main file referenced automatically whenever debugging. For example when you have index.php, which is the file called from the browser, and it includes a file called include.php. Now when your breakpoint is include.php it will still load the file index.php in Sublime when executed.
Thanks
So I went into the project settings and defined my url and for the index.php file, debugging works. If I try to debug another page it does not work. Any ideas?
"settings": {
"xdebug": { "url": "http://localhost/index.php" }
}
Hi. I've trying the debugger with a PHP project, but it only works on PHP scripts directly called through another PHP script. It doesn't stop on scripts called trough a JQuery Ajax petition. Do I have to add another extra parameter or something?
Thanks in advance for your answer. Fully working debugging it's the only thing keeping me from doing the complete switch from Netbeans.
It hangs in infinitive...
recvfrom(21, "", 1024, 0, NULL, NULL) = 0
recvfrom(21, "", 1024, 0, NULL, NULL) = 0
recvfrom(21, "", 1024, 0, NULL, NULL) = 0
bluszcz@X ~> sudo lsof -p 32176 |grep 21u
sublime_t 32176 bluszcz 21u IPv4 291037 0t0 TCP localhost:9000->localhost:45079 (CLOSE_WAIT)
bluszcz@X ~>
It may be xdebug error, resolved here: http://forums.netbeans.org/viewtopic.php?p=141779#141779
,but plugin should be bullet proofed enough to not crash as well.
There is also similar problem described here: http://stackoverflow.com/questions/14033240/debugging-not-starting
Hello!
This might be a mistake by myself. I'm running Ubuntu 12.10 python 2.7 set up xdebug and a plugin in chrome to catch the session. Now that works and the menu in sublime changes, but I won't get any results on breakpoints - no stacks and so on.
Now that's not all. After a few seconds (~6 to 10 seconds) sublime sometimes doesn't respond any more.
Also "Execute" does nothing.
Thanks for any help
This may be a lot of work (and likely language-specific), but thought it was worth requesting. If not the tooltip/hover, at least some basic way to inspect the value of code, including arrays, objects, strings, etc.
Is there a way to make the information for arrays and objects expandable to be able to get the properties for member variables key=>value information?
I create a simple mockup of interface to use XDebug.
A pop-up occur on variable user wont to inspect after some ms cursor is on variable AND is not moving. Popup display variable var_dump result. Structured object ARE NOT navigable (all data are display) and data can't be changed (not change workflow).
Breakpoint are more visible using a red circle then an arrow, and I think is a good improvement highlight in a different color the current breakpoint (green?)
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:
<- 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
... would be awesome.
Just getting started with SublimeXdebug here, I'm noticing variables are reported under the Xdebug console as "uninitialized." What's the deal here?
Screenshot: http://d.pr/i/GEHV
Hi,
I've seen this morning the message about settings for xdebug in the .sublime-project file.
I think this setting should not be in the .sublime-project file, they should be in the .sublime-workspace file.
Because in the case of multiple developer working on the project, the sublime-project file is common to all developers, and the .sublime-workspace file is specific to the developer. We commit the project file (and share it) but not the workspace. (see the overview : http://www.sublimetext.com/docs/2/projects.html )
And specifically for the project url, each developer has his own working instance, with his own url.
This setting seems to be unusable in a such working environment.
Best regards,
Python has the recursion limit.
So after I get an error "maximum recursion depth exceeded" in Ubuntu x64 12.04 in file Xdebug.py (function read_until_null()).
I rewrite this function:
def read_until_null(self):
if self.connected:
while not '\x00' in self.buffer:
self.buffer += self.sock.recv(self.read_rate)
data, self.buffer = self.buffer.split('\x00', 1)
return data
else:
raise(ProtocolConnectionException, "Not Connected")
May be this will be usefull for someone.
When debugging code that has some global class member calls, such as CLASS::memeber_function($a), the cursor skip that line but it actually executed, which leads to the cursor be positioned in odd places after that, as it gets offset.
Got this error on when running SublimeXDebug on Mac Lion (10.7) and Sublime Text 2 (Build 2203)
Please take a look if you can
Cheers
Traceback (most recent call last):
File "/Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py", line 356, in run_
return self.run(edit, **args)
File "./Xdebug.py", line 448, in run
File "./Xdebug.py", line 467, in callback
AttributeError: 'NoneType' object has no attribute 'current'
my app
app is my sublime project
--app
-------htdoc
--------------index.php
when i use shif+f8 start debugging, it show no url defined in project setting file, where is the project setting file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.