#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:
Georg Brandl 2010-12-04 16:00:47 +00:00
parent 1ed77f300b
commit 44f2b640ff
4 changed files with 47 additions and 7 deletions

View file

@ -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)