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

Python Debugger

by wvlia5 ST3 Trending

Graphical Debugger for Sublime Text

Details

Installs

  • Total 9K
  • Win 5K
  • OS X 2K
  • Linux 2K
May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11
Windows 12 31 25 32 31 19 10 14 18 19 24 22 13 14 32 23 22 28 19 19 11 22 24 22 19 17 17 16 16 20 21 25 24 17 16 19 18 28 20 26 23 17 14 22 31 22
OS X 6 7 6 9 9 7 6 3 9 8 13 11 8 7 3 12 10 6 15 4 8 2 6 8 9 12 9 7 5 7 11 7 5 4 5 5 13 6 12 6 4 3 6 12 8 9
Linux 9 11 12 9 8 4 9 7 10 16 8 10 16 9 6 5 6 8 8 9 6 7 14 8 10 8 19 7 8 14 18 16 16 12 3 9 10 8 6 13 12 4 5 12 15 13

Readme

Source
raw.​githubusercontent.​com

SublimeDebugger

This is a graphical debugger for Sublime Text 3.

screenshot

Hire Me

The developer of this project needs a job. I can relocate anywhere in the world or work remotely. I have a degree in Mechanical Engineering. wvlia5@live.com.ar

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?