Plugin Debugger
Debug Sublime Plugins with Winpdb graphical python debugger.
Details
Installs
- Total 4K
- Win 3K
- Mac 667
- Linux 896
Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- bitbucket.org
PluginDebugger
This package contains some little glue code to use nice Winpdb graphical python debugger for debugging sublime plugins.
Usage
Here is a little python snippet of debug_example.py:
import sublime_plugin import sys class DebugExampleCommand(sublime_plugin.WindowCommand): def run(self, **kwargs): sys.stderr.write("started\n") i = 4 import spdb ; spdb.start() z = 5
- spdb.start()
- winpdb will be launched, if not yet launched from Plugin Debugger. Each later call of this function sets a breakpoint. If winpdb (started from Plugin Debugger) has been terminated in between, it will be restarted.
- spdb.setbreak()
- sets a breakpoint. You need to have to attached debug client for using this.
Note
If you start winpdb manually, use sublime as password for finding scripts on localhost.
Install
Install this Package using Package Control.
Additionally to this package you have to install Winpdb from http://winpdb.org/download/ (or apt-get install winpdb on debian-like systems).
Configuration
The only configuration option is plugin_debugger_python, which can be set in your User Settings file Packages/User/Preferences.sublime-sttings. This specifies the full path to your python installation, where you installed Winpdb. Please note, that this must be a python 2.x (2.7 recommended). You can also debug Python3 with this.
I recommend using Preferences Editor to set it ;) .
Test your installation
Run "Plugin Debugger: run debug_example (opens Debugger)" from command palette.
Your sublime text will freeze for few seconds and then will open a winpdb window ready for debugging DebugExampleCommand.
Module rpdb2 havily hooks into python interpreter, so if you really want to quit the debug session, you have to restart your sublime text.
Once Winpdb has opened, you should keep it open, because it will inform you on any uncaught exception. If you close winpdb, your sublime simply freezes on an uncaught exception (because it breaks on that exception), but you are not informed on this because of missing frontend.
Snippets
There is a spdb snippet, which inserts:
import spdb ; spdb.start(0)
Bugs
Please post bugs to https://bitbucket.org/klorenz/plugindebugger/issues.
Known Issues
I tried to automatically unload rpdb2 library and undo all its hooking into python system, but failed till now.
I also tried to get a nice status bar message about loading the Plugin Debugger using Package Control's thread_progress, but I did not manage yet to run a thread unattended of the debugger yet (that it is not affected by setbreak call).
For now I will stop working on automatic unloading, because restarting sublime text after a debug session is fine for me (at least for now).
Changes
- 2014-04-12
- Add Python-3.3.3-Lib.zip, for correct display of pyhton lib debugging.
- Handle now also all Packages files, even if in .sublime-package files.
- 2014-01-22
- pre-import packages, which are imported by rpdb2, such that they are loaded from ST environment rather than from environment, where winpdb is installed
- replace Plugin Debugger.sublime-settings by Preferences.sublime-settings for easier settings handling.
- run external python from temporary directory, to prevent to have sublime text folder in modules path.
Author
Kay-Uwe (Kiwi) Lorenz <kiwi@franka.dyndns.org> (http://quelltexter.org)
Support my work on Sublime Text Plugins: Donate via Paypal