mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
commit
8d676bd061
3 changed files with 42 additions and 0 deletions
23
news/xontrib-pdb.rst
Normal file
23
news/xontrib-pdb.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* ``pdb`` xontrib, that runs pdb debugger on reception of SIGUSR1 signal.
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -164,6 +164,11 @@
|
|||
"description": ["Get identifiers, names, paths, URLs and words from the previous command output ",
|
||||
"and use them for the next command."]
|
||||
},
|
||||
{"name": "pdb",
|
||||
"package": "xonsh",
|
||||
"url": "http://xon.sh",
|
||||
"description": ["Simple built-in debugger. Runs pdb on reception of SIGUSR1 signal."]
|
||||
},
|
||||
{"name": "powerline",
|
||||
"package": "xontrib-powerline",
|
||||
"url": "https://github.com/santagada/xontrib-powerline",
|
||||
|
|
14
xontrib/pdb.py
Normal file
14
xontrib/pdb.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
"""Simple built-in debugger. Runs pdb on reception of SIGUSR1 signal."""
|
||||
import signal
|
||||
|
||||
__all__ = ()
|
||||
|
||||
|
||||
def handle_sigusr1(sig, frame):
|
||||
print("\nSIGUSR1 signal received. Starting interactive debugger...", flush=True)
|
||||
import pdb
|
||||
|
||||
pdb.Pdb().set_trace(frame)
|
||||
|
||||
|
||||
signal.signal(signal.SIGUSR1, handle_sigusr1)
|
Loading…
Add table
Reference in a new issue