Skip to content

Python client and Emacs extension for PyDev debugger

License

Notifications You must be signed in to change notification settings

nyyManni/pydev-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyDev Client

This project is still in beta, so it may require some extra actions to get it running. Your mileage may vary.

PyDev (https://github.com/fabioz/PyDev.Debugger) is the Python debugger used in PyCharm and Eclipse’s PyDev-plugin. It supports debugging multi-threaded applications such as Django or CherryPy -based projects.

This repository contains a command-line client for PyDev, and realgud-bindings for using it inside Emacs.

Features:

Implemented commands:

Parameters and outputs are similar to those of trepan3k-debugger.

commandshortdescription
startstart the debugger
stepsstep into
nextnstep over
returnrstep out
breakbadd breakpoint
deleteremove breakopint
continueccontinue execution after break
evaleevaluate an expression
exit/quit^Dexit the debugger (server will be killed with SIGTERM)
listllist file contents around current position

Features to be implemented:

  • Enabling/disabling breakpoints
  • Moving up/down frames
  • Restarting the debugger
  • Breakpoint conditional expressions
  • Better input handling, arrow keys not working since we are using readline for now. Reason for using readline instead of raw_input is that readline can be used with select.
  • Tests
  • Better handling for multiple threads, currently the client selects one thread as an active one. A thread that stops at a breakpoint is always selected as active
  • Supporting multiple simultaneous sessions inside emacs, requires some way to get a free port number for the server and the client to become aware of it.

Python client

Installation:

python setup.py install

This will install the client, and PyDev debugger daemon as a dependency.

Usage:

Start the daemon:

pydevd --port port --server --file filename [arguments ...]

or

pydevd --port port --server --module --file filename [arguments ...]

Start the client:

pydevc --server 127.0.0.1 --port port

The client has connected to the remote debugger when you see prompt (pydev).

Realgud extension

Installation:

Add following to your init file (requires use-package to be installed):

(use-package realgud-pydev
  :load-path "/path/to/pydev-client")

Usage:

M-x realgud:pydev-current-file

or

M-x realgud:pydev-module

Virtual environments work as expected at least with pyvenv, if the python modules have been installed to the specific virtual environment.

The pydevd-server will be opened in a separate process, and it’s output will be shown in a separate emacs buffer. This makes it easier to use the command-line interface when the output of the debugged program does not mess up the interface.

Compiling PyDev debugger

To get much more performance from the debugger server, you can compile it with Cython:

  1. Clone the PyDev repository from https://github.com/fabioz/PyDev.Debugger
  2. Ensure you have cython installed
    pip install cython
        
  3. Compile the library
    python setup_cython.py build_ext --inplace
        
  4. Install the library
    pip install .
        

About

Python client and Emacs extension for PyDev debugger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published