https://github.com/sassoftware/epdb
Extended Python Debugger
https://github.com/sassoftware/epdb
Last synced: 5 months ago
JSON representation
Extended Python Debugger
- Host: GitHub
- URL: https://github.com/sassoftware/epdb
- Owner: sassoftware
- License: mit
- Created: 2014-09-22T17:03:34.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T17:38:09.000Z (over 1 year ago)
- Last Synced: 2025-04-02T08:13:13.762Z (7 months ago)
- Language: Python
- Size: 335 KB
- Stars: 76
- Watchers: 12
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
- Support: SUPPORT.md
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
========
Overview
========
Adds functionality to the python debugger, including support for remote
debugging
Installation
============
::
pip install epdb
Usage
=====
For debugging code locally, epdb generally works the same as `pdb
`_. You can debug a program from
the python interpreter::
>>> import epdb
>>> import mymodule
>>> epdb.Epdb().run('mymodule.test()')
*** NameError: name 'execfile' is not defined
> /home/wasche/git/epdb/(1)()
-> """
(Epdb) continue
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python3.5/bdb.py", line 431, in run
exec(cmd, globals, locals)
File "", line 1, in
File "/home/wasche/git/epdb/mymodule.py", line 2, in test
import spam
ImportError: No module named 'spam'
You can also drop breakpoints at specific places in a program's code by
inserting::
import epdb; epdb.set_trace()
or by using the alias ``st``::
import epdb; epdb.st()
To debug code that is either running on a remote system, or in a process that
isn't attached to your tty you can use epdb in server mode::
import epdb; epdb.serve()
By default ``epdb.serve()`` will start a simple telnet server on port 8080, but
you can use the ``port`` keyword argument to use a different port::
import epdb; epdb.serve(port=8888)
You can connect to the epdb server by using ``epdb.connect()``::
>>> import epdb
>>> epdb.connect()
By default ``epdb.connect()`` will attempt to connect to port 8080 on
localhost. If you are debugging a process on another host or port, you can call
connect with the ``host`` or ``port`` keyword arguments::
>>> import epdb
>>> epdb.connect(host='some.host.com', port=8888)
Known Issues
============
* epdb.serve() does not work with python 2.7.5 [#7]