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

Python Debugger

by matiasmorant ST3

Graphical Debugger for Sublime Text

Details

Installs

  • Total 55K
  • Win 33K
  • Mac 9K
  • Linux 13K
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 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27
Windows 0 5 2 2 2 4 6 12 9 1 8 5 5 8 2 3 5 6 8 2 5 3 6 4 2 0 4 5 5 7 6 0 4 3 4 8 1 5 6 5 5 6 7 1 2 3
Mac 1 0 0 1 1 0 3 1 1 0 1 1 0 1 3 1 1 1 0 0 2 0 0 0 1 0 1 4 1 2 0 0 3 0 3 2 2 0 2 2 1 1 0 2 0 2
Linux 0 1 2 1 3 2 1 2 2 2 2 2 2 1 0 1 3 0 2 3 5 4 1 3 3 1 2 3 3 4 2 1 1 1 2 3 1 1 0 0 3 1 0 3 3 1

Readme

Source
raw.​githubusercontent.​com

SublimeDebugger

This is a graphical debugger for Sublime Text 3.

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?