summaryrefslogtreecommitdiffstats
path: root/Doc/library/pdb.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-30 08:29:39 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-30 08:29:39 (GMT)
commite023091815e4946e42c1af102be1f258b2f47cb8 (patch)
treefe5b2c9d398005733710fea747f6658cd21907cf /Doc/library/pdb.rst
parent1e30bd3753e7b08dce13ff1e18ac1ae5c397fcea (diff)
downloadcpython-e023091815e4946e42c1af102be1f258b2f47cb8.zip
cpython-e023091815e4946e42c1af102be1f258b2f47cb8.tar.gz
cpython-e023091815e4946e42c1af102be1f258b2f47cb8.tar.bz2
#1437051: allow "continue"/"next"/etc. in .pdbrc, also add pdb -c option to give these commands. This allows to run a script until an exception occurs.
Diffstat (limited to 'Doc/library/pdb.rst')
-rw-r--r--Doc/library/pdb.rst17
1 files changed, 13 insertions, 4 deletions
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst
index 654af8e..e279db8 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -44,11 +44,15 @@ example::
python3 -m pdb myscript.py
When invoked as a script, pdb will automatically enter post-mortem debugging if
-the program being debugged exits abnormally. After post-mortem debugging (or
-after normal exit of the program), pdb will restart the program. Automatic
+the program being debugged exits abnormally. After post-mortem debugging (or
+after normal exit of the program), pdb will restart the program. Automatic
restarting preserves pdb's state (such as breakpoints) and in most cases is more
useful than quitting the debugger upon program's exit.
+.. versionadded:: 3.2
+ :file:`pdb.py` now accepts a ``-c`` option that executes commands as if given
+ in a :file:`.pdbrc` file, see :ref:`debugger-commands`.
+
The typical usage to break into the debugger from a running program is to
insert ::
@@ -202,6 +206,11 @@ prompt. This is particularly useful for aliases. If both files exist, the one
in the home directory is read first and aliases defined there can be overridden
by the local file.
+.. versionchanged:: 3.2
+ :file:`.pdbrc` can now contain commands that continue debugging, such as
+ :pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no
+ effect.
+
.. pdbcommand:: h(elp) [command]
@@ -388,9 +397,9 @@ by the local file.
As an example, here are two useful aliases (especially when placed in the
:file:`.pdbrc` file)::
- #Print instance variables (usage "pi classInst")
+ # Print instance variables (usage "pi classInst")
alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
- #Print instance variables in self
+ # Print instance variables in self
alias ps pi self
.. pdbcommand:: unalias name