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

Python Debugger

by wvlia5 ST3 Trending

Graphical Debugger for Sublime Text

Details

Installs

  • Total 3K
  • Win 1K
  • OS X 583
  • Linux 699
Nov 24 Nov 23 Nov 22 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
Windows 20 24 26 29 20 15 16 20 31 31 20 16 22 15 31 28 26 20 21 16 11 22 23 26 26 27 17 25 32 16 16 17 11 8 13 14 12 17 23 15 11 16 17 14 9 13
OS X 8 9 12 5 7 6 8 9 8 11 18 6 5 9 8 8 10 4 3 10 6 8 6 4 11 7 12 2 15 6 10 3 5 3 2 13 5 5 5 8 1 5 4 8 2 5
Linux 7 10 15 10 7 17 5 10 18 10 11 8 8 8 9 12 15 10 16 4 19 14 10 17 10 22 11 9 7 11 5 4 6 2 5 7 4 4 6 4 1 5 5 14 7 8

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.

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?