ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Python Debugger

by wvlia5 ST3

No description provided

Details

Installs

  • Total 652
  • Win 337
  • OS X 156
  • Linux 159
Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7
Windows 4 21 19 20 19 28 29 23 18 11 10 13 16 17 14 14 22 14 13 14 14 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 9 11 7 4 22 15 12 11 2 2 6 13 8 5 3 2 2 6 7 14 2 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 7 10 7 8 5 11 12 12 7 4 2 9 14 6 12 6 10 5 4 7 3 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
raw.​githubusercontent.​com

SublimeDebugger

This is a graphical debugger for Sublime Text 3. If this saves you some time with those nasty bugs of yours, feel free to buy me a coffee at PayPal.

screenshot

Features

  • Setting breakpoints, using either keyboard shortcuts or the console.
  • Local and Global Variables Inspector
  • Expression Watcher
  • Breakpoints Editor
  • Step, Continue, Next, Outer/Inner frame through the console

Languages Supported

  • Python 2
  • Python 3

How to add support to your favourite Language

You've got to write a backend for the debugger. They are located in the backends folder. Your backend should implement a class with the following members (Which will be called by the frontend):

  • set_break(filename, line, bpinfo)

Is called by the frontend to set a breakpoint. bppinfo is a dict containing info about the breakpoint (backend dependant).

  • clear_break(filename, line)

Is called by the frontend to clear a breakpoint.

  • toggle_break(filename, line)

Is called by the frontend to toggle a breakpoint.

  • tryeval(expr)

Is called by the frontend to evaluate an expression. It is needed to fill the Expression Watcher. Should return the result of the evaluated expression in the current context.

  • runscript(filename)

Is called by the frontend to start debugging a program.

  • breakpoints

A dict of breakpoints. The structure of the dict is the following:

{
    filename1:
    {
        line1: bpinfo1,
        line2: bpinfo2,
        line3: bpinfo3,
        etc..
    },
    filename2:
    etc..
 }

where each bpinfo is a dict with backend dependant content.

  • parent

An member that will be set by the frontend, it will have the methods mentioned next.

Additionally, the following methods of the frontend should be called by your backend when relevant (accessed through the parent member of your backend):

  • get_cmd(line, locals, globals, filename)

Request a command from the user.

  • set_break(filename, line, bpinfo)

Set a breakpoint in the Sublime GUI

  • clear_break(filename,line)

Clear a breakpoint of the Sublime GUI

  • toggle_break(filename,line)

Toggle a breakpoint in the Sublime GUI

  • show_help(help_str)

Show the help message help_str in Sublime

  • show_exception(message)

Show an exception message in Sublime

Then import the backend from mydebugger.py. Add your language to Main.sublime-menu and to languageCommand in mydebugger.py

The Python3 backend (dbPython3.py) is the simpler one, take a look at that for guidance. Also, contact me if you really mean to implement one, I'll help you so we can include it here afterwards. wvlia5@live.com.ar

TODO

  • ST2 support?
  • better exception handling (I think it can't be made better since it is managed by bdb)
  • toggle hide special members
  • configuring breakpoints from Breakpoints Watcher?
  • multifile support
  • test on windows
  • context key bindings with filename?