mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
#7245: Add a SIGINT handler on continue in pdb that allows to break a program again by pressing Ctrl-C.
This commit is contained in:
parent
1ed77f300b
commit
44f2b640ff
4 changed files with 47 additions and 7 deletions
|
|
@ -135,7 +135,8 @@ The ``run_*`` functions and :func:`set_trace` are aliases for instantiating the
|
|||
:class:`Pdb` class and calling the method of the same name. If you want to
|
||||
access further features, you have to do this yourself:
|
||||
|
||||
.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None)
|
||||
.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None, \
|
||||
nosigint=False)
|
||||
|
||||
:class:`Pdb` is the debugger class.
|
||||
|
||||
|
|
@ -146,6 +147,11 @@ access further features, you have to do this yourself:
|
|||
patterns. The debugger will not step into frames that originate in a module
|
||||
that matches one of these patterns. [1]_
|
||||
|
||||
By default, Pdb sets a handler for the SIGINT signal (which is sent when the
|
||||
user presses Ctrl-C on the console) when you give a ``continue`` command.
|
||||
This allows you to break into the debugger again by pressing Ctrl-C. If you
|
||||
want Pdb not to touch the SIGINT handler, set *nosigint* tot true.
|
||||
|
||||
Example call to enable tracing with *skip*::
|
||||
|
||||
import pdb; pdb.Pdb(skip=['django.*']).set_trace()
|
||||
|
|
@ -153,6 +159,10 @@ access further features, you have to do this yourself:
|
|||
.. versionadded:: 3.1
|
||||
The *skip* argument.
|
||||
|
||||
.. versionadded:: 3.2
|
||||
The *nosigint* argument. Previously, a SIGINT handler was never set by
|
||||
Pdb.
|
||||
|
||||
.. method:: run(statement, globals=None, locals=None)
|
||||
runeval(expression, globals=None, locals=None)
|
||||
runcall(function, *args, **kwds)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue